cout not printing full string

This is a discussion on cout not printing full string within the C++ Programming forums, part of the General Programming Boards category; My programme reads a line from a text file using
in_file_stream1.getline(read_record,255);
Each line in the file contains four fields, the ...

cout not printing full string

My programme reads a line from a text file using

in_file_stream1.getline(read_record,255);

Each line in the file contains four fields, the numerical fields are right justified which means there will be a variable number of spaces between the fields. An example is
80-09V 7.00 470632.30 419554.80

Under certain circumstances the programme will detect an error and I want to display the line where the error occurred using cout in a console.

If I do this with

cout << read_record;

only the first part of the line is displayed - up to the first space. How can I get cout to display the full string?

How's read_record defined? It would also be interesting to take a look at the read loop code.

Meanwhile you can use in_file_stream1.eof(), in_file_stream1.fail() and in_file_stream1.bad() to diagnose the possible error. Trying to output the stream with cout is not useful because chances are it is corrupted already.

Within the loop there is a function to parse the read_record and do some calculations based on the different fields. The two last numerical fields are x and y map coordinates and the error I need to spot is if two consecutive records have the same x and y coordinates, because this will cause division by zero and crash the programme. The value of getting cout to print the whole line if this occurs, instead of just the line number, is that you can then paste the cout output into a text editor search box and go straight to the problem line.