Reading input files

5
4
1 2 45
1 3 4
2 3 16
2 4 6
3 4 8


This is my input file format. What I need to be able to do is to process a specific line, say line 2. I need to read it in and store the second line only to an int variable. How could I go about doing this?
Sorry, I don't even want to consider that option. I know there are much simpler ways to just convert the type. The character I need to store will always be in line 2; I can create a counter to figure out where to stop easily. Need something more along the lines of converting from char to int with one simple line of code. Not willing to write a couple of loops for the solution.
According to many opinions on the internet....

int vertexCount = line.c_str(); should be legal.

I don't understand why something so so so so so very simple is proving difficult.
Topic archived. No new replies allowed.