User forums > Help
cant use double vars
(1/1)
mnorman:
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?
stahta01:
--- Quote from: 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?
--- End quote ---
User Error; I suggest going to another site like 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
Tim S.
mnorman:
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.
Jenna:
--- Quote from: stahta01 on October 30, 2013, 03:50:32 am ---
--- Quote from: 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?
--- End quote ---
User Error; I suggest going to another site like 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
Tim S.
--- End quote ---
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.
--- Quote from: MortenMacFly on January 24, 2009, 09:14:54 pm ---[...]
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.
[...]
--- End quote ---
Please respect the rules in the future !
Topic locked !
Nevertheles, your code runs fine on my machine (linux 64-bit with gcc4.8).
Navigation
[0] Message Index
Go to full version