- #1
Joon
- 85
- 2
Hello, the text file I'm trying to read is formatted as below:
I have used getline to discard the first line, the header.
What I'm wondering is that after I read the file with ifstream then wrote the code as inFile >> char >> x1 >> y1 >> z1 , then calculated something using x1,y1,z1, the output gives a weird number. I think it is because of point1 which is char + number, how should I set point1 as character then read it with the code above?
C:
x y z
point1 number number number
What I'm wondering is that after I read the file with ifstream then wrote the code as inFile >> char >> x1 >> y1 >> z1 , then calculated something using x1,y1,z1, the output gives a weird number. I think it is because of point1 which is char + number, how should I set point1 as character then read it with the code above?
Last edited: