# Thread: A Very noobie question!

1. ## A Very noobie question!

Hey

I am currently working on a c++ program that can work out the temperatures and pressures along a Jet Engine, however there is one simple problem that is getting in my way.

How do I do indicies in C++?

Some of the calcualtions involve T3T4= (P3/P2) ^ (Y/Y-1)

But I dont know how to get an indice to work in C++, I get an error message complaining about the presence of the floating poing numbers, does anyone know how to implement an indice?

2. pow [C++ Reference]

^ in C++ performs a bitwise XOR

3. Originally Posted by MWAAAHAAA
pow [C++ Reference]

^ in C++ performs a bitwise XOR
Thankyou :-) I am too used to matlab for these things...

4. Originally Posted by ewandougie
Thankyou :-) I am too used to matlab for these things...
Actually, I was wondering if there was a reason you were not using Matlab.

5. Originally Posted by ewandougie
Hey

I am currently working on a c++ program that can work out the temperatures and pressures along a Jet Engine, however there is one simple problem that is getting in my way.

How do I do indicies in C++?

Some of the calcualtions involve T3T4= (P3/P2) ^ (Y/Y-1)

But I dont know how to get an indice to work in C++, I get an error message complaining about the presence of the floating poing numbers, does anyone know how to implement an indice?
If you mean with ^ to the power as T3T4= (P3/P2) to the power of (Y/Y-1)

then you should include <cmath>

and then the statment will be as T3T4= pow((P3/P2),(Y/(Y-1)));

My Regard,
Salmi

6. More precisely std::pow((P3/P2),(Y/(Y-1)));
Or alternatively a using namespace std; at the top of your source file.