Pages: [1]
|
|
|
|
Author
|
Topic: C++ debugging anyone? (Read 52 times)
|
|
Guardian_Tenshi
Global Moderator
Karma: +53/-26
Offline
Gender:
Posts: 1114
|
|
C++ debugging anyone?
« on: January 22, 2004, 01:42:19 AM »
|
|
ok, so they assigned this nice "easy" assignment to get back into the jist of writing C++ pgms, and now instead of ANSI C, it's all straight C++. No worries, not that hard to make the switch...but I think I've finished the assignment, but I'm having some problems compiling...it keeps telling me that:
assign1.cc:120: parse error before `)' token assign1.cc:128: parse error before `)' token
The function in question is this one:
*****************************************************************************************/ double drawTable(double hitemp,double lotemp,int tempinc,double hispeed,double lospeed,int spdinc) { double i,j,k; //loop counters cout << endl << "Air temperature"; cout << setw(8) << "(deg. F)"; for (i=hitemp,i=lotemp,i+=tempinc) //line 120 { cout << setw(8) << i; } //cout << endl << "--------------------------" << endl; for (j=lospeed,j=highspeed,j+=spdinc) { cout << j; for (k=hitemp,k=lotemp,k+=tempinc) //line 128 { cout << calcWindChill(k,j); } cout << endl; } } /****** END FUNC #2********/
|
|
It's not due til tuesday, but I'd like to have it figured it out before then.
|
|
Logged
|
|
|
|
Porter
[Wumpa]
Board Admin
Karma: +176/--88
Offline
Gender:
Posts: 3910
|
|
Re:C++ debugging anyone?
« Reply #1 on: January 22, 2004, 08:03:25 AM »
|
|
I think the problem is that you need to use semi-colons in your for() statement, not commas.
|
|
Logged
|
[Wumpa] Porter --Silent, professional, lethal... sometimes.
|
|
|
Deuce
CSR Super Ultra Mega Nerd
Global Moderator
Karma: +169/--41
Offline
Gender:
Posts: 2914
|
|
Re:C++ debugging anyone?
« Reply #2 on: January 22, 2004, 08:20:30 AM »
|
|
10 PRINT "HA HA HA" 20 GOTO 10
sorry..thats the best i can do to help
|
|
Logged
|
|
|
|
Fotty
Admin Team CSR Connoisseur
Karma: +35/-10
Offline
Gender:
Posts: 840
|
|
Re:C++ debugging anyone?
« Reply #3 on: January 22, 2004, 08:20:33 AM »
|
|
yup C for statements are semicolon all the way
|
|
Logged
|
|
|
|
Guardian_Tenshi
Global Moderator
Karma: +53/-26
Offline
Gender:
Posts: 1114
|
|
Re:C++ debugging anyone?
« Reply #4 on: January 22, 2004, 06:36:47 PM »
|
|
the correction in my for loop exit conditions fixed the compiling problems, i had to make a few other corrections to clean up my output, but not a big deal, for the most part. By the way porter,to "clear the screen" you can use the \f in a print statement to get a nice fresh screen.
std::cout << "\f"; //clears screen
|
|
Thanks for everyone who offered help
|
|
Logged
|
|
|
|
Porter
[Wumpa]
Board Admin
Karma: +176/--88
Offline
Gender:
Posts: 3910
|
|
Re:C++ debugging anyone?
« Reply #5 on: January 22, 2004, 10:25:10 PM »
|
|
See, you learn something every day.
|
|
Logged
|
[Wumpa] Porter --Silent, professional, lethal... sometimes.
|
|
|
Guardian_Tenshi
Global Moderator
Karma: +53/-26
Offline
Gender:
Posts: 1114
|
|
Re:C++ debugging anyone?
« Reply #6 on: January 27, 2004, 01:54:05 PM »
|
|
i should point out though that \f implies "form feed" and it doesn't work on all machines...it works on the schools machines, but Dr.McMahon doesn't recommend using it as an everyday thing...in fact, he basically told me i should take it out of my code...I was impressed that I at least found it though...
Tenshi
|
|
Logged
|
|
|
|
Porter
[Wumpa]
Board Admin
Karma: +176/--88
Offline
Gender:
Posts: 3910
|
|
Re:C++ debugging anyone?
« Reply #7 on: January 27, 2004, 02:12:18 PM »
|
|
Yeah, in today's age it's MUCH more important for your code to be portable that "clean looking".
|
|
Logged
|
[Wumpa] Porter --Silent, professional, lethal... sometimes.
|
|
|
Fotty
Admin Team CSR Connoisseur
Karma: +35/-10
Offline
Gender:
Posts: 840
|
|
Re:C++ debugging anyone?
« Reply #8 on: January 27, 2004, 03:54:26 PM »
|
|
thats why all the code i write is dirty
|
|
Logged
|
|
|
|
Pages: [1]
|
|
|
|
|
|
CSReloaded Forums | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved. |
|
|