exponents in c++
how do you write exponents in c++ i though it was "exp (#)" afterthe variable am i right?
tyczj
Junior Poster in Training
91 posts since Mar 2005
Reputation Points: 10
Solved Threads: 1
As a constant?
#include <iostream>
int main()
{
double value = 1.23456E+3;
std::cout << "value = " << value << '\n';
return 0;
}
/* my output
value = 1234.56
*/
Dave Sinkula
long time no c
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
no not as a constant but never mind i figured it out.
i have another question though, im getting an error and i have no clue what it means?
"error c2447: missing function header (old-style formal list)"
tyczj
Junior Poster in Training
91 posts since Mar 2005
Reputation Points: 10
Solved Threads: 1
>"error c2447: missing function header (old-style formal list)"
And the line of code that goes with this error? Clearly you're trying to do something that looks something like a K&R style function definition, but C++ doesn't allow those.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
um not sure what K&R is; have not learned that yet but the line where the error is the "{" right after main to start writing the code
tyczj
Junior Poster in Training
91 posts since Mar 2005
Reputation Points: 10
Solved Threads: 1
>um not sure what K&R is
You aren't supposed to unless you have a perverse fascination with ancient dialects of C.
>the line where the error is the "{" right after main
That is soooooo incredibly NOT helpful. Not even I can debug a program given one character (most of the time ;)). How about posting that line as well as five lines above it (using code tags, because I'm not in the best of moods).
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401