I'm new to C++ and I'm studying out of a book (Game Programming - All In One, 2002) From what I've seen from other programs it's sort of out of date. Can someone tel me what's wrong with this?
-Error C2734: 'Value' : const object must be initialized if not extern
(It origionaly used std::cout and std::cin)
#include <iostream>
using namespace std;
main (void)
{
const float Value, FeetPerMeter = Value;
float Length1;
float Length2;
float Length3;
cout << "Enter the first lenght in meters: ";
cin >> Length1;
cout << "Enter the second length in meters: ";
cin >> Length2;
cout << "Enter the third lenght in meters: ";
cin >> Length3;
cout << "First length in feet is: " << Length1 * FeetPerMeter << endl;
cout << "Second length in feet is: " << Length2 * FeetPerMeter << endl;
cout << "Third length in feet is: " << Length3 * FeetPerMeter << endl;
return 0;
}
This is what the book told me to insert, but it even looks incorrect to me. HMM, does anyone know what's wrong with this?