Computer Science Canada error, idk how to fix... |
Author: | Aenoc [ Wed Nov 05, 2008 8:34 pm ] | ||||
Post subject: | error, idk how to fix... | ||||
here is my code,,.... it has 2 functions, 1 to raise a float number. say 3.4 to 4, and 1 to lower a float say 3.4 again, to 3.... when i compile the program it reads two errors. 1) line 28: warning: old-style declaration or incorrect type for: Uceil 2) line 36: warning: old-style declaration or incorrect type for: Ufloor can anyone help???. its just practise for a midterm so no marks for it but i dont get why its doing it.. lol so may cause things on midterm...
Mod Edit: Remember code tags! ![]()
|
Author: | OneOffDriveByPoster [ Wed Nov 05, 2008 9:44 pm ] | ||||
Post subject: | Re: error, idk how to fix... | ||||
You have
and
Both are bad. The first because main() should be declared to return int in standard C. The second because you are missing the return type--that is, you are using "implicit int". There are more issues really, but I think you could figure them out. |
Author: | Aenoc [ Wed Nov 05, 2008 9:51 pm ] |
Post subject: | Re: error, idk how to fix... |
ok that was a quick fix =P sumtimes im stupid. thx |
Author: | wtd [ Wed Nov 05, 2008 10:21 pm ] |
Post subject: | RE:error, idk how to fix... |
It's not your fault that you missed the fixes. C is a very permissive language. You can make mistakes and it'll still work... but just in some different way than you expected. Experience gives you the ability to deal with this effectively. |