Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Andrew_N_1
Beginner
60 Views

New functions for reading files iostream etc

its been a fair while since I did c and c++ at university. What I'd like to know is what functions and headers are best for reading text from a file. I'm looking to read engineering data such as floats , doubles etc written as text in the file in various formats I.e some lines may have 4 floats and others may be more or a mix of text and floats. Is there a faster way than using sscanf and reading a line by fgets?

 

 

0 Kudos
1 Reply
Yuan_C_Intel
Employee
60 Views

Hi,

Searching from internet there are quite a lot of solution on this.

Using C++ iostream, read floats from text can be very simple. For example, see answer from:

http://stackoverflow.com/questions/8421170/read-floats-from-a-txt-file

Hope this helps.

Thanks.

Reply