Tumlee 42 Junior Poster in Training

The pow function takes two doubles. x and y were declared as integers. When you put two integers in the pow function the compiler doesn't know what to do.

You have two choices. You can either declare x and y as type "float" or "double" instead of "int", or you can do this:

cout << " The answer is " << ( pow( (double)x, (double)y)) << endl;
Tumlee 42 Junior Poster in Training

<string.h> is a C-compliant headers that provide functions for comparing, copying, and doing other things to arrays of characters (For example, "char* foo" or "char buf[128]"). strcmp(), strcpy(), and whatnot are included from there. They actually don't do anything with the "string" class.

<string> is for C++, and that is what defines the actual "string" class, which is much more advanced. If you're using both, just include both.

Tumlee 42 Junior Poster in Training

As long as that part of the input will always be a single character, yes, you will be able to do that.

Also, if you want to make your code shorter, I believe fscanf returns the number of arguments filled, so you could fill multiple data element with a single call to fscanf().

The third argument you're using looks like it has a decimal point, also, so you should probably use float to avoid headaches.

if (fscanf(f, "%d %d %f %c", &long1deg, &long1min, &long1sec, &orien1lon) == 4)
{
  //Success
}
else
{
  //ERROR!
}