![]() |
|
#1
|
|||
|
|||
error: expected unqualified-id before "if"here is the source code:
CPP / C++ / C Code:
what did I do wrong? oh and im thinking of making it if Fahrenheit = Fahrenheit... etc EDIT: if I am not going about the repeat properly, could you tell me how i would go about it please? help is much appreciated, thanks, Dillon |
|||
|
#2
|
|||
|
|||
Re: error: expected unqualified-id before "if"Just a comment, the C interpreter & compiler system doesnt care about whitespace, but humans usually do. So when you place your semicolons, try to put them at the end of the statement they conclude
CPP / C++ / C Code:
CPP / C++ / C Code:
CPP / C++ / C Code:
CPP / C++ / C Code:
One other thing to note about your conditionals, to test for equality you will want to use the == operator instead of teh = (assignment) operator. Compilers usually give a warning about this, but it is a tricky bug to track down. Try to fix those errors and post back with your progress. |
|
#3
|
|||
|
|||
Re: error: expected unqualified-id before "if"Quote:
What do you suggest I do instead? I've tried everything, and no matter what I do, i still run into some sort of problem. I'm beginning to think that there actually characters that have "unqualified-id" as a type of character and want to know which one to put. BTW, thanks for the other advice |
|
#4
|
|||
|
|||
Re: error: expected unqualified-id before "if"In order to define a function, you need to provide the block that will be executed when the function is called. In C/C++ that block is enclosed in { and }.
So, for example CPP / C++ / C Code:
What you have put together is a declaration, you need to provide the definition of main. So wrap whatever code you want to execute inside the opening and closing brackets. |
Recent GIDBlog
Running Linux Programs at Boot Time by gidnetwork
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Network Sites: GIDNetwork · GIDApp · GIDSearch · Learning Journal by J de Silva, The