Code::Blocks Forums
User forums => Help => Topic started by: mnorman on October 30, 2013, 03:22:09 am
-
I downloaded both the newest (12.I forget) and 10.05 versions of codeblocks on my windows 7 64bit laptop. Whenever I try and do any sort of operation with a double type variable (print, scan, any sort of math), even if it is initialized to something, the result always comes up as 0.00000000. Anyone got any ideas?
-
I downloaded both the newest (12.I forget) and 10.05 versions of codeblocks on my windows 7 64bit laptop. Whenever I try and do any sort of operation with a double type variable (print, scan, any sort of math), even if it is initialized to something, the result always comes up as 0.00000000. Anyone got any ideas?
User Error; I suggest going to another site like http://cboard.cprogramming.com/forum.php (http://cboard.cprogramming.com/forum.php)
And, post your bad code and ask for help.
Please re-read the rules! http://forums.codeblocks.org/index.php/topic,9996.0.html (http://forums.codeblocks.org/index.php/topic,9996.0.html)
Tim S.
-
believe me its not user error
double i = 9.4;
printf ("%lf", i);
prints 0.0000000, I don't mean to sound argumentative but I've gone through everything I can find on alternative ways for printing doubles. I can use ints and chars with no issues just doubles are not functioning.
-
I downloaded both the newest (12.I forget) and 10.05 versions of codeblocks on my windows 7 64bit laptop. Whenever I try and do any sort of operation with a double type variable (print, scan, any sort of math), even if it is initialized to something, the result always comes up as 0.00000000. Anyone got any ideas?
User Error; I suggest going to another site like http://cboard.cprogramming.com/forum.php (http://cboard.cprogramming.com/forum.php)
And, post your bad code and ask for help.
Please re-read the rules! http://forums.codeblocks.org/index.php/topic,9996.0.html (http://forums.codeblocks.org/index.php/topic,9996.0.html)
Tim S.
To be more precise than Tim:
User or compiler error (the second is very unlikely).
In both cases it has nothing to do with C::B and it shows, that you did not read (or understand) the rules, even after Tim has posted the link for you.
Be aware that you violate our forum rules and that such posts might get deleted (or locked) silently without comment.
[...]
1. This is NOT a general programming board. "How do I write a program that....", "Can anybody teach me how to", "I have this homework", "My program doesn't run and I don't have the slightest idea of why because I'm a C++ newcomer", "What is a compiler", "What does gcc do" is the kind of questions that is FORBIDDEN to ask.
2. Compiler/Linker errors are NOT Code::Blocks errors. Usually, C++ newcomers tend to confuse the Editor/IDE (Code::Blocks) with the Compiler (MINGW / GCC). You may see some errors in the compiler output because you missed to do something right in your code. But that's not Code::Blocks troubleshooting, that's C++ troubleshooting and does not belong in here. If your program doesn't compile, READ THE C++ MANUAL.
[...]
Finale note: Ignoring these rules may result in the topic being (silently) locked and/or even removed completely without any notice.
[...]
Please respect the rules in the future !
Topic locked !
Nevertheles, your code runs fine on my machine (linux 64-bit with gcc4.8).