how do you write exponents in c++ i though it was "exp (#)" afterthe variable am i right?

Recommended Answers

All 5 Replies

As a constant?

#include <iostream>

int main()
{
   double value = 1.23456E+3;
   std::cout << "value = " << value << '\n';
   return 0;
}

/* my output
value = 1234.56
*/

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)"

>"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.

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

>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).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.