Okay I've just started learning c++ in college but I'm stuck on a bit of what to do to get the program to read from an file with floats.
I've got floats like 38.5 33.6 44.45 42.86.
I am told to read these floats ("temperatures") in the program. I start out the code this way.
#include <iostream>
#include <fstream>
#include <iomanip>
using namespace std;
int main()
{
ifstream absoluteval;
absoluteval.open("tempinput.txt");
string w;
getline(absoluteval,w);
}
This is what I got so far but when I made an cout to check and see if it shows up correctly for these it comes up with 0 x 0 in the command prompt.