|
|
char
? This looks like a mathematical calculation which requires type double
.^
is for bitwise operations on integers.
|
|
*
?double
previously...double
can accept letter variables. Is it possible?
But i must be sure that double can accept letter variables. Is it possible? |
char
.int
, double
also does not support letter variables. I've also tried to use string
, without forgetting to #include <string>
, but this has proved to be useless, as it conflicts with pow() and *
.
(3x+2)^5 = 243x^5 + 810x^4 + 1080x^3 + 720x^2 + 240x + 32 |
(3x^2 - 2/x)^3 = 27x^6 - 54x^3 - 8/x^3 + 36 |
You probably want to take the input as a string then split it into the letter and number. |
|
|
int
at this point.
Error: more than one instance of overloaded function 'pow' matches the argument list: |
1>------ Build started: Project: BasicCalc2, Configuration: Debug Win32 ------ 1> BasicCalc2.cpp 1>c:\users\arthur\documents\visual studio 2010\projects\basiccalc2\basiccalc2\basiccalc2.cpp(65): error C2668: 'pow' : ambiguous call to overloaded function 1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(583): could be 'long double pow(long double,int)' 1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(535): or 'float pow(float,int)' 1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(497): or 'double pow(double,int)' 1> while trying to match the argument list '(int, int)' 1>c:\users\arthur\documents\visual studio 2010\projects\basiccalc2\basiccalc2\basiccalc2.cpp(67): error C2668: 'pow' : ambiguous call to overloaded function 1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(583): could be 'long double pow(long double,int)' 1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(535): or 'float pow(float,int)' 1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(497): or 'double pow(double,int)' 1> while trying to match the argument list '(int, int)' ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== |
d=(pow((float)a,c));