void overwriteoptionparta()
{
cout <<"Would you like to overwrite a truck?"<< endl;
cout << "Or would you like to create a new document?" << endl;
cout << "1 or yes : 2 for no" << endl;
cin >> overwrite;
if (overwrite = 1)
{
writefile.open("temp.dat",ios::out);
for (int index = 1; x<19; x++)
if (strcmp(sp1truck1, "L")!=THE_SAME&&sp1truck1checker == 0)
{
cout << index <<": ";
cout <<sp1truck1<<endl;
tempa = 1;
writefile << sp1truck1 <<endl;
}
else
//few more if statments..pretty much the same as above
//just different variabes
else
if ( strcmp(sp2truck9, "L")!=THE_SAME&&sp2truck9checker==0)
{
cout << index <<": ";
cout <<sp2truck9<<endl;
sp2truck9checker = 1;
writefile << sp2truck9 <<endl;
}
}//end loop
writefile.close(); //close temp.dat
}//end if
} //end function
..semicolons are in right places..?? now when compiling this i get the error..
" error C2143: syntax error : missing ';' before '}' "
this error occurs on the line that closes the function..
oh.. and the reasson I have L for comparing.. well..trust me..theres a reasson.. but it will take a long time to explain..besides thats not the point...
i cant figure out whats wrong.. Iv declared writefile correctly..so..???...Im lost.. and I despretly need help
OH GODS OF THE CODE..BLESS MY WITH YOUR KNOWLEDGE
thanx (in advance)
Edited by - slightlywhacked on 11/11/00 12:47:42 AM
Edited by - slightlywhacked on 11/11/00 12:49:10 AM
Running out of time!! HELP!! PLEASE!
I know i posted this message already, but i didnt get that much help.. but i have three more days untill i get this project done.. I have it all done, and just going through and fixing errors.. I need t have this done by monday.. please help me.. and forgive me for reposting
i get a wierd error asking for a semi colon..when i dont need one (so i think).. this is my code. )well not the whole thing.. but the chunk thats screwing up
BAHcows go moomoos go cow
your codes crap, start over & use sub routines :p
And this is for game development, not homework developement.
And this is for game development, not homework developement.
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
The reason is simple: your braces don''t match up. Looks to me like you forgot the opening brace for your ''for'' loop. The way you''ve got this code aligned doesn''t make any sense at all, and the fact that you''re asking this question about it just shows that all this will do is confuse you. Pick an indenting style and stick with it! It will do you a world of good. Leave some space between identifiers and operators, and finally, try capitalizing each word of a variable or function name; don''t use overwriteoptionparta, use OverwriteOptionPartA. All these things will make the debugging process easier on you. If you were indenting your code in a uniform manner, you would have caught this error right away...
-Ironblayde
Aeon Software
Next thing you know, they''ll take my thoughts away.
-Ironblayde
Aeon Software
Next thing you know, they''ll take my thoughts away.
"Your superior intellect is no match for our puny weapons!"
i do ident them in a uniform style.. its just when i posted it in that little box thingy inthe posting screen i was trying to make everything fir on single lines.. for exsample the if statment would take up two lines..that just makes it harder to read.. same with the space between the variables and stuff..same reasson. Im not using hungarian notation (think thatss what its called) cause i was in a rush when i made it...
as for this site being for gamedevelpment..I know.. I alwasy post questions on direct x things, and I alwasy get help.. so i though HEy...seen as how this time I have a normal app question.. might as well post it where i post everything else.. most people are pretty helpful here...
and thanx ironblayde
as for this site being for gamedevelpment..I know.. I alwasy post questions on direct x things, and I alwasy get help.. so i though HEy...seen as how this time I have a normal app question.. might as well post it where i post everything else.. most people are pretty helpful here...
and thanx ironblayde
BAHcows go moomoos go cow
// First error: if (overwrite = 1)
// Change to: if (1 == overwrite)
// Comment: You are actually *assigning 1 to overwrite when
// you do if (overwrite = 1). to *compare, you do ''==''. A
// good thing to remember is to put the constant in the
// expression (this time, it is 1), before the variable, so you
// get if (1 == overwrite). that way, if you accidentally do ''=''
// instead of ''=='', the compiler will complain, because it can''t
// assign overwrite to 1. It just can''t!.
// Second thing: in the for (int index...) loop, do you really
// mean to go from 1 to 18? or 1 to 19? the loop will go from
// 1 to 18 as it is. (x < 19)
// Third: This is it buddy! You are missing an opening for loop
// brace. Just stick one of those curly dudes right after your
// for loop, and it should start workin!
// for (...)
// {
// blah...
// }
// thats the prob.
// Fourth: Try changing the if statement ( if (strcmp
// (sp1truck1, "L")!=THE_SAME&&sp1truck1checker == 0) )
// to if (((strcmp (sp1truck1, "L") != THE_SAME) && (sp1truck1checker == 0) )
// Once again, it would be good if you try to change your if''s so
// that the constants in the expression preceed the variables.
// I think that''s all...
farmersckn
// Change to: if (1 == overwrite)
// Comment: You are actually *assigning 1 to overwrite when
// you do if (overwrite = 1). to *compare, you do ''==''. A
// good thing to remember is to put the constant in the
// expression (this time, it is 1), before the variable, so you
// get if (1 == overwrite). that way, if you accidentally do ''=''
// instead of ''=='', the compiler will complain, because it can''t
// assign overwrite to 1. It just can''t!.
// Second thing: in the for (int index...) loop, do you really
// mean to go from 1 to 18? or 1 to 19? the loop will go from
// 1 to 18 as it is. (x < 19)
// Third: This is it buddy! You are missing an opening for loop
// brace. Just stick one of those curly dudes right after your
// for loop, and it should start workin!
// for (...)
// {
// blah...
// }
// thats the prob.
// Fourth: Try changing the if statement ( if (strcmp
// (sp1truck1, "L")!=THE_SAME&&sp1truck1checker == 0) )
// to if (((strcmp (sp1truck1, "L") != THE_SAME) && (sp1truck1checker == 0) )
// Once again, it would be good if you try to change your if''s so
// that the constants in the expression preceed the variables.
// I think that''s all...
farmersckn
Yesterday is the past, tomorrow is the future. Today is a gift, that is why we call it the present.
farmersckn, why did you comment out your entire post? (sorry, i coudn''t help myself)
quote: Original post by Quantum
farmersckn, why did you comment out your entire post? (sorry, i coudn''t help myself)
LOL! I suppose I didn''t notice... I started out just copying his code in and adding comments, then I took his code out and left my comments... // Besides, I like the little // thingys!
////////////////////////////AHhahahHAhha////////////////////////
farmersckn
Yesterday is the past, tomorrow is the future. Today is a gift, that is why we call it the present.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement