When I compile and run it, it does read from the file. If I make a file containing the contents
+ 5.4 7.5
the program gives me 12.9 like it should. What problem are you getting?
Type: Posts; User: TheBigH
When I compile and run it, it does read from the file. If I make a file containing the contents
+ 5.4 7.5
the program gives me 12.9 like it should. What problem are you getting?
You want
if( choice == 'H' )
A single equals sign tells the program to set 'choice' to be whatever 'H' is. To test whether the two are equal you need a double equals.