Forum: C++ Sep 5th, 2009 |
| Replies: 4 Views: 313 #define isn't what you need. #define does compile-time text substitution, as if you'd done a search-replace just before every compilation.
That looks like a reasonable idea. You'll probably want... |
Forum: C++ Sep 3rd, 2009 |
| Replies: 4 Views: 313 Yes, new members register at an astonishing rate here . . . when I logged in there were six less members than there are now. :)
[Sorry if this is a bit advanced. I assume you're a pretty good... |
Forum: C++ Aug 31st, 2009 |
| Replies: 5 Views: 404 You use -99 in your input file to indicate end of line, but you seem to expect -999 in your program . . . .
Just a thought: why don't you read in one line at a time, and treat that as the row of a... |
Forum: C++ Aug 5th, 2008 |
| Replies: 9 Views: 3,650 The best way to do this is perhaps this: declare a structure representing the information. (Perhaps a header structure, a data one, a tail, and a packet structure that contains all three.)
If you... |
Forum: C++ Aug 5th, 2008 |
| Replies: 18 Views: 1,640 What? Never heard of that. Don't tell me,
this don't work
x = bool (x||y) ;
That is C++ only. The C way looks like this.
x = (bool)(x || y);
Perhaps the OP is compiling as C instead of C++.
... |
Forum: C++ Jul 16th, 2008 |
| Replies: 8 Views: 797 So your question is, why does structure alignment apply to the last member of a structure?
I think the answer is the same as for why structure alignment exists in the first place. Structure... |
Forum: C++ Jul 2nd, 2008 |
| Replies: 4 Views: 597 In order to use the ifstream fin variable that you declare inside the switch statement, you need to declare it outside the switch statement. For example:
ifstream fin;
switch(choose) {
case 1:
... |
Forum: C++ Jul 2nd, 2008 |
| Replies: 27 Views: 2,129 http://board.theprogrammingsite.com/viewtopic.php?t=113&sid=57532b7c18db0b6089757cc195c714b4 |
Forum: C++ Sep 14th, 2006 |
| Replies: 4 Views: 11,705 I imagine the overhead would not be great (unless your program is written in C++); TC fits on four floppy disks and it runs on an XT computer. But switching to an old compiler just so you can use its... |
Forum: C++ Feb 9th, 2006 |
| Replies: 6 Views: 3,568 You have to decrement listSize if you don't want it to print -999. eg
cout <<"Enter a maximum of 100 positive integers ending with -999"<<endl;
readNum (Numbers, listsize);
... |
Forum: C++ Dec 10th, 2005 |
| Replies: 11 Views: 1,847 Sorry, I can't view your file (this stupid computer doesn't have WinZIP!), but I'm going to guess you're not clearing the keyboard buffer.
This will clear the keyboard buffer (it's in C):
int c;... |
Forum: C++ Dec 8th, 2005 |
| Replies: 4 Views: 1,250 Yes, unless you want a global variable. |
Forum: C++ Dec 8th, 2005 |
| Replies: 4 Views: 1,250 doctor* Array[5];
for(int i=0;i<2;i++)
Array isn't initialized. And if it was, you're only looping through two of its five elements. |
Forum: C++ Nov 30th, 2005 |
| Replies: 15 Views: 2,430 |