I'm doing a program for class, trying to make a conversion for feet, inches, miles, and yards to meters, but I keep getting the error C2065 message. This is the program as I've made it so far:
#include <iostream>
using namespace std;
int main ()
{
const int FEET_PER_MILE = 5280;
const int YARDS_PER_MILE = 1760;
const int FEET_PER_YARD = 3;
const int INCHES_PER_YARD = 36;
const int INCHES_PER_FOOT = 12;
const float METERS_PER_INCH = 0.0254;
The error happens in the second and third lines of each conversion, saying that, for example:
ConversionTable2.cpp(14) : error C2065 : 'yards' : undeclared identifier
ConversionTable2.cpp(15) : error C2065 : 'meters' : undeclared identifier
ConversionTable2.cpp(15) : error C2065 : 'yards' : undeclared identifier
I need some help. Can anyone tell me what I'm doing wrong?