- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page