difference between sin and fin?

can someone explain what sin means and does in this code? thank you.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
		// get line
		getline(fin,line);
		istringstream sin(line);

		// get all answers in line
		int answer;
		while(!sin.eof())
		{
			sin >> answer;
			answers[i].push_back(answer);
		}
        i++; // counter
	}

Last edited on
I jumped on this thinking it meant the sin() function from cmath, but it looks like its an fstream or similar object. If you #include <cmath> you will get an error unless you wrap that code in a namespace.
i thought it was used with #include<sstream> and was used the same way as fin. but i am not sure why sin is used instead of fin. i could be wrong though..any ideas?
file input
stringstream input
Last edited on
Topic archived. No new replies allowed.