exponents in c++

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Mar 2005
Posts: 91
Reputation: tyczj is an unknown quantity at this point 
Solved Threads: 1
tyczj tyczj is offline Offline
Junior Poster in Training

exponents in c++

 
0
  #1
Mar 15th, 2005
how do you write exponents in c++ i though it was "exp (#)" afterthe variable am i right?
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 4,442
Reputation: Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future 
Solved Threads: 250
Team Colleague
Dave Sinkula's Avatar
Dave Sinkula Dave Sinkula is offline Offline
long time no c

Re: exponents in c++

 
0
  #2
Mar 15th, 2005
As a constant?
#include <iostream>

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

/* my output
value = 1234.56
*/
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 91
Reputation: tyczj is an unknown quantity at this point 
Solved Threads: 1
tyczj tyczj is offline Offline
Junior Poster in Training

Re: exponents in c++

 
0
  #3
Mar 15th, 2005
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)"
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,813
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 747
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Senior Bitch

Re: exponents in c++

 
0
  #4
Mar 15th, 2005
>"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.
New members chased away this month: 3
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 91
Reputation: tyczj is an unknown quantity at this point 
Solved Threads: 1
tyczj tyczj is offline Offline
Junior Poster in Training

Re: exponents in c++

 
0
  #5
Mar 15th, 2005
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
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,813
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 747
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Senior Bitch

Re: exponents in c++

 
0
  #6
Mar 15th, 2005
>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).
New members chased away this month: 3
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC