I think I might be having trouble understanding variable initialization again, but thanks for the help. Also, if there is an operator for raising to powers, not scientific notation, I would appreciate hearing about it since I can't seem to find it in the index

Recommended Answers

All 2 Replies

Use double pow(double,double) function from <math.h> (<cmath> in modern C++) header.

double x = 2.0;
double y = 2.0;
double four = pow(x,y);

There is no operator for raising to powers in C++ similar to the ** operator in Python. You can do the multiplication or use the pow library function as suggested.

Be a part of the DaniWeb community

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