N/A

]
Last edited on
Hi,
I think you need to go over some of the tutorials on this site first to be honest (especially on functions). for example why have this:

1
2
3
4
5
double sin(double val);
double cos(double val);
double tan(double val);
double sqrt(double val);
double log(double val);

in the middle of your main function? If you want to "incorporate the cmath functions" you don't need to do this at all. Delete these lines, #include<string>, then do something like this:

1
2
3
4
5
6
case 'S':

			double result = sin(val);
			cout << "The sine of your number is " << std::to_string(result) << endl;

			break;

for your cases.

and this:
cout << "The cosine of your number is " << val *
you haven't even bothered finishing the line of code.
Last edited on
Man, I hate it when people do that.
> If you want to "incorporate the cmath functions" (...) #include<string>
¿wtf?


> cout << "The sine of your number is " << std::to_string(result) << endl;
¿why do you need `to_string()'?
You don't need to_string, sorry. However:


If you want to "incorporate the cmath functions" (...) #include<string>

Do not mis-quote me.
Last edited on
That wasn't the intention, that's how I read it. You don't give any solution to get those function then.

By the way, there is no problem to declare functions inside other functions. That means that only that function knows about their existence.
Topic archived. No new replies allowed.