i have some sort of problem with my Variables. im using Dev-C++
when i do this i get 4012464 no matter what i set my numbers to. i'm pretty sure that's wrong. its very possible im making a nube mistake. plz help me. =(
Look at where your ) and , are.
Then add these flags to the compiler settings
-W -Wall -ansi -pedantic -O2
With any luck, you'll be told that the printf string has too few parameters.
do u mean i have my , and ) backwards?
and what was the compiler option thing. i couldn't find it on my program.
Yes, you do. Sort of. You're passing the value of "z" to printf(), so it has to be inside printf()'s parentheses.
In Dev-C++, I believe you go to Tools->Compiler Options. Then add what Salem suggested into the "extra compiler options" textbox. (It might be in a different tab, I can't remember.)
yay! the programs works.
now i can finish the bigger program i was doing before i ran in to this problem.
Hello World? (Sorry, couldn't resist).
...i was doing the same thing with the scanf() function
Did you manage to enable compiler warnings? If you have a reasonably recent version of Dev-C++ (4.9.x.x would be good enough), it should tell you when you make mistakes like that.
I think on Dev C++ 4.9.(whatever build they are on these days) you can simply mark a check box to enable these options as well.