429 Posted Topics

Member Avatar for atman

They are declared in the parameter list so that you can pass address to the function. if you declare them as local variables inside the function how will you pass the address of the variables to that function? mainly it depends on the requirement where and how you use pointers.

Member Avatar for devnar
0
288
Member Avatar for elsa87

1> Please use 'code tags', do you see the 'Help with code Tags' on the right hand corner of your code? click that and read. 2>print_reverse definition should be preceded by scope resolution operator. 3>I don't see anywhere where you are writing the output to outstream? please make these changes …

Member Avatar for cikara21
0
513
Member Avatar for karang

is this file present in the Test directory? can you post the include statement or the .h file if possible?

Member Avatar for Agni
0
241
Member Avatar for preet4fun
Re: help

[quote]incode.open(" C:\\Dev-Cpp\\inventory.txt");[/quote] is that space between " and C: there in the original code also? you can remove that space and try.

Member Avatar for preet4fun
0
168
Member Avatar for dtaylor01

Please dont start 2 threads for the same problem. did you read the comments that were posted in the other thread? [URL="http://www.daniweb.com/forums/thread159012.html"]http://www.daniweb.com/forums/thread159012.html[/URL]

Member Avatar for vmanes
0
109
Member Avatar for dtaylor01

i think it should be [code]int calculation(l *w);[/code] and the other function seems alright.

Member Avatar for Lerner
0
191
Member Avatar for JimD C++ Newb

Dont use 'eof' as an exit indicator for the loop. eof() is true only after the end of file is read and not when end of file is reached as a result your getting one extra character. use while(file.getline(<args>)) instead of 'eof'.

Member Avatar for JimD C++ Newb
0
202
Member Avatar for akira_shinizaki
Member Avatar for Agni
0
94
Member Avatar for Agni

Hi guys.. I'm facing a problem in my project. Basically its a small project for a retail store inbound section. The goods come in cartons and the user enters the carton ID in the UI to accept the carton. In the backend the carton details get updated in the table …

Member Avatar for Agni
0
91
Member Avatar for Gannon56789
Member Avatar for Agni
0
212
Member Avatar for MylesDBaker

1> Destructor does the cleaning up once the object goes out of scope. it doesnt have a return type, has the same name as the class name but preceded by a '~' . like your assignment alreasy says '~Point( )', defined has [code] Point::~Point( ) { //dtor } [/code] just …

Member Avatar for Lerner
0
201
Member Avatar for Agni

i posted this in geeks lounge, got no response, so posting it here... Hi Guys... Anyone can share which are the top universities in UK for a Masters in Software Engineering and related fields? And how are they, compared to the top Univs in US and Canada?

Member Avatar for jbennet
0
160
Member Avatar for jazzyangelz

Please use 'Code Tags' for posting code to your qs. you will need one more loop, something like [code=cplusplus] for(int row_A=0; row_A<num; row_A++) { for(int row_B=0;row_B<=row_A;row_B++) { cout << ch; } cout << "\n"; } [/code]

Member Avatar for jazzyangelz
0
96
Member Avatar for Se7Olutionyg

[QUOTE=Se7Olutionyg;708607]i got it, but can you explain me the difference between float computeGross (float, float); float computeNet (float money); thansk[/QUOTE] First of all you need to use code-tags always .. Nobody will even look at your code if its not easy to read, so without going through your code i'll …

Member Avatar for rati
0
122
Member Avatar for Agni

Hi Guys... Anyone can share which are the top universities in UK for a Masters in Software Engineering and related fields? And how are they, compared to the top Univs in US and Canada?

0
45
Member Avatar for DemonGal711
Member Avatar for DemonGal711
0
52
Member Avatar for afromong

There are a lot of such examples here on daniweb, mostly using the 'while' loop. you can try and search for it in here... something like char y = 'Y'; while(y == 'Y' || y == 'y') { // some code cout << "Do you want to continue?"; cin >> …

Member Avatar for chunalt787
0
110
Member Avatar for JackDurden

or you could do something like ... [code]int* arr = new int[rows * cols];[/code] then go on adding elements to it ...

Member Avatar for Agni
0
277
Member Avatar for Dontais

While loop is obviously not the right choice here .. whatever grade you enter will satisfy the condition always and the loop becomes infinite... just a simple 'if' should do i think if its to happen only once. or else you can use a 'yes'-'no' sort of menu.

Member Avatar for Dontais
0
113
Member Avatar for justinlake888

[code] if(!Continue()) { cout << "bye" <<endl; } [/code] is this what you want?

Member Avatar for stilllearning
0
114
Member Avatar for unk45

you could do just like you're doing in the first part 1> ask the user if he wants to search by 1) firstName 2) LastName using a cout, you can create this menu 2> Then based on the menu option selected, search the array something like void getperson(person holdspeople[maxpeople], int …

Member Avatar for stilllearning
0
232
Member Avatar for tones1986

A math grad student at Rutgers [[URL="http://recursed.blogspot.com/2008/07/rutgers-graduate-student-finds-new.html"]http://recursed.blogspot.com/2008/07/rutgers-graduate-student-finds-new.html[/URL]] has come up with a formula which can generate infinite primes Let a(1) = 7 Define: a(n) = a(n-1) + gcd(n,a(n-1)) Then the prime generator is : a(n) - a(n-1) [one needs to ignore the 1s and then ignore the repeated primes] Ain't …

Member Avatar for skatamatic
0
429
Member Avatar for Agni

Hi, The same code as my previous post, but because of this list thing, i'm not able to run specific commands for different options. Here i have 2 options under the 'Names' Menu, 'rajat','prasun', now when the user selects either of them i should be able to know which one …

Member Avatar for Agni
0
99
Member Avatar for Agni

Hi, Below is my test code, i have a list of names in a file, i read the names and i have to insert them as menu options in the menubar. Since its a dynamic menu and people can add new menu's it has to be read from a file …

Member Avatar for Agni
0
242
Member Avatar for dmanw100
Member Avatar for mauro21pl

Its working correctly for me .. output: What is the number : 10 The nodes contain the numbers: 10 --> NULL What is the number : 2 The nodes contain the numbers: 2 -->10 --> NULL What is the number : 15 The nodes contain the numbers: 2 -->10 -->15 …

Member Avatar for Salem
0
102
Member Avatar for dmanw100

and you need a default constructor of the class too, since you have declared your own ctor the compiler will not generate it for you...

Member Avatar for Agni
0
119
Member Avatar for balakrishnan.kb

you can find loads of examples-definitions on google.. go through them.. then when you have more specific doubts ppl here can help .. happy learning :)

Member Avatar for Narue
0
109
Member Avatar for shipeshipaca
Member Avatar for dmanw100

[CODE]fstream openfile; openfile("my_file.txt"); if(openfile.fail()) { cout<<"Error opening file."; } else { mainprog(); }[/CODE] i'm surprised that this doesn't give you a compilation error. when i compile it i get a straight forward error fileopenDan.cpp(9) : error C2064: term does not evaluate to a function and the both the forms work …

Member Avatar for l4z3r
0
159
Member Avatar for Agni

Hi Guys, i just wrote a program to print a sentence backwards using recursion. But i'm not too happy about it, if someone can give me a more optimized solution i'll be glad. You have to use std::string class. input: where the streets have no name output: name no have …

Member Avatar for Agni
0
348
Member Avatar for davidleeis14

you could add one more field to the structure which specifies the 'member_type' and write that to your file then when you load the file based on the 'member_type' you can create the correct object type.

Member Avatar for Agni
0
4K
Member Avatar for delsigno

for pointers you access the class members using '->' hence the line should be [code]int i = Human->getHealth();[/code] see the error carefully [quote]left of '.getHealth' must have class/struct/union [/quote] if its a class/struct/union you can use '.'

Member Avatar for delsigno
0
105
Member Avatar for prog77

or else you can use an array of FILE* if you want to use them elsewhere in the program. or write a structure with elements as FILE* and filename and use an array of that structure.

Member Avatar for prog77
0
179
Member Avatar for hellooo

[quote]what i have to put in the fopen? [/quote] i think you need a '/' something line "e:/reservat.txt" This is more of a C code though and please read about 'code-tags'.

Member Avatar for Agni
0
137
Member Avatar for FTProtocol
Member Avatar for FTProtocol
0
98
Member Avatar for QuantNeeds

Hi, This code is too difficult to read. Can you please post a well formatted-indented code with code type specified as c++? and also post the entire code including the 'main'. I tried going through this but its just giving me a headache.

Member Avatar for Agni
0
160
Member Avatar for splakhin

yes you need to make it multi-threaded. Everytime the user clicks on the button it can spawn a new thread which does the work and the button is free for input. i think this code should help you [code=python] from Tkinter import * import threading import time class process(threading.Thread): def …

Member Avatar for splakhin
0
140
Member Avatar for Agni

Hi, has anyone used the mdb debugger in solaris? I need to debug a core file on a client Machine which has neither dbx nor gdb. i could only find mdb, unfortunately i've never used mdb and it's kind of tricky. i dont know if people still use it these …

0
74
Member Avatar for Agni

This is my code for a chat client. I create a simple UI with a text box for viewing the chat and an entry widget to write messages. There's a button called 'Connect', when i click this i start a new thread which does the connection and keeps receiving messages …

0
88
Member Avatar for chaoticabyss99

you're trying to 'cout' the return value of some method, but the method might be returning 'void'.

Member Avatar for chaoticabyss99
0
255
Member Avatar for ambarisha.kn
Member Avatar for perfectlover09

It all boils down to understanding how arrays are stored in memory and how we access each element of an array. arrays are stored sequentially in memory. So lets say you declare and array of 5 integers int arr[5]; in memory you can imagine it to be 5 cells allocated …

Member Avatar for Ancient Dragon
1
228
Member Avatar for java_girl
Member Avatar for dwks
0
123
Member Avatar for uompearl
Member Avatar for Narue
0
92
Member Avatar for Alex Edwards

Though i'd like to believe otherwise but i think he's right to a large extent. Even in my own company they are porting the entire product from c++ to java and we have been asked to decide weather we'd like to move to Java or stay in c++ for supporting …

Member Avatar for sciwizeh
0
293
Member Avatar for Agni

Hi Guys.. I need to know how to debug the 'main' of an exe using dbx. i cant put a 'sleep' and recompile it. For example in windows using visual .Net i can do something like >devenv /debugexe xyz.exe This will bring up the exe in debugmode. i need the …

Member Avatar for Agni
0
124
Member Avatar for Agni

Hi Guys... i'm sure the topic has given you a braod hint and if u've still been brave enough to open this just help me out... i have a dual boot system, windows XP and Ubuntu 7.1. i need to change this setup to a virtual machine setup, host xp …

Member Avatar for taramichael
0
140
Member Avatar for Scuppery

You need to give more info dude. As far as usage is concerned just look into any python tutorial on WWW

Member Avatar for jrcagle
0
5K
Member Avatar for Agni

[code=c++] #include <iostream> using namespace std; class Lock { friend class First; private: Lock() { } }; class First : virtual public Lock { public: void function() { cout << "function1" << endl; } }; class Second: public First { public: void function2() { cout << "function2" << endl; } …

Member Avatar for ash05
0
161

The End.