reading a newline or a space from a file

hi i was wondering if anyone can point me in the right direction.
i havea file that contains roman numerals and integer that could be in this format:
X 10
IV 4

or this format:
I
X
20.

i want to read into the file and test just the first line to see if it either reaches a space, meaning it follows the first format, or a newline, meaning it follows the second format. but i am not sure how to get started with this. i tried to write a quick code but with a test file in the second format it always run the ' ' case even though in the file it goes to a newline. i dont know what i am doing wrong. please please point me in right direction

1
2
3
4
5
6
7
8
9
10
11
  for (int i = 0; i < 3; i++)
	{
		string trail;
		testing >> word;
		switch (testing.peek())
		{
		case '\n': trail = "newline"; break;

		case ' ': trail = "space"; break;
		}
		cout << trail << endl;
or if anyone know how i can check to see if there is a roman numeral and its integer equivalence separated by a space in the first line that would be helpful too.
Topic archived. No new replies allowed.