- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 5
- Posts with Upvotes
- 5
- Upvoting Members
- 3
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
7 Posted Topics
Aside from a lot of poor style (e.g. you should never have "using namespace" at global level in any header file) and not showing important parts of the code (e.g. the declaration of customers), you're pretty close. I'm guessing that customers is: [CODE] Customer* customers[10]; [/CODE] because the new operator …
Try like this: [code] void ExprTree::setVariable(const string& s, double d) { vector<Variable>::iterator pos; for(pos = varList.begin(); pos!= varList.end(); ++pos) { if(pos->data == s) { //two equals for comparison *pos = Variable(s,d); // one equals for assignment return; // you're wasting time continuing to loop after you found a match } …
The computer doesn't store the number in decimal form. It just displays it that way. Also your input isn't being converted into the internal binary number either, unless you call a conversion function to do so. How are you getting the input (command-line, cin, fread, gets, ReadFile, text box)? You'll …
[QUOTE=firstPerson;1005664]Disappointed to see you suggest a non-standard function. In C++ you should use sstream for conversion from string to numbers. [/QUOTE] Or just read an integer from the cin stream in the first place.
Use a while loop instead. Also, the for loop is a lot more flexible than "count from 0 to N". The syntax is: for ( initialize ; condition ; update ) controlled_statement_or_block condition can be anything, not just i <= N. For example, looping through a string often looks like: …
Your original code is using pass-by-value. The value you're passing is a pointer (really an address) but your function still gets a copy of the pointer. So data1 and data2 inside the function are separate from data1 and data2 outside. Now you're changing data1 to point somewhere new, if you …
There could be more than one copy of notepad.exe running you know. See EnumProcesses, example here: [URL="http://msdn.microsoft.com/en-us/library/ms682623(VS.85).aspx"]http://msdn.microsoft.com/en-us/library/ms682623(VS.85).aspx[/URL]
The End.
rbv