I am having a problem with the line that calculates the data. It keeps saying non-lvalue. I noticed
there are differences between, my book (borland) and my compiler (bloodshed), am I using an old method to calculate units? Any help you can offer would be greatly appreciated.
Code:// Height in miles // going to be a program to calculate height in diff units #include<iostream> main() { unsigned int feet; unsigned int inches; unsigned int heightIninches; unsigned int heightInmiles; unsigned int f = 5280; std::cout<<"What is your height? \n "; //outputs the question to the screen std::cout<<"First give the feet, then the inches, ok? \n "; system ("pause"); std::cout<<"OK First, how many feet are you tall? \n "; std::cin>>feet; //allows input to the num variable system ("pause"); std::cout<<"and now the trailing number of inches you are tall \n "; std::cin>>inches; feet*12+inches=heightIninches; return heightIninches; std::cout<<"So your height in inches is "<< heightIninches << "\n"; system ("pause"); std::cout<<"To see you height in miles press any key \n"; system ("pause"); f/heightIninches = heightInmiles; return heightInmiles; std::cout<<"You are "<< heightInmiles << " miles tall \n"; system ("pause"); return 0; } //63360 = num of inches in a mile



LinkBack URL
About LinkBacks


