Timeline for Read numeric data from a text file using C++
Current License: CC BY-SA 3.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 13, 2017 at 7:38 | comment | added | Nerdrigo | @miscco Yes, I reserve some amount of space for my vectors, I have another file (related to this one) that tells me exactly how many points are there. Though the file I am talking about is an upper bound, usually this file has fewer cells. | |
Apr 12, 2017 at 20:04 | comment | added | Loki Astari |
Check this out ignore punctuation using manipulator. Basically you can get the stream to treat the comma like it was a space by imbuing it with a custom std::codecvt . That way you don't need to run over the line and remove commas from potentially arbitrary long lines.
|
|
Apr 12, 2017 at 18:05 | answer | added | miscco | timeline score: 0 | |
Apr 12, 2017 at 17:57 | comment | added | miscco | Just to be sure, you do reserve a sensible amount of space for your vectors? Otherwise memory reallocations are going to be one of the main slowdowns of your program. If you do not know the number of lines beforehand you should be able to estimate them from the size of the file. | |
Apr 12, 2017 at 17:35 | comment | added | Incomputable |
This is the best fit problem for std::ctype<char> (note that it is very different from its template version). Just set the comma to be space.
|
|
Apr 12, 2017 at 16:25 | answer | added | Helion | timeline score: 1 | |
Apr 12, 2017 at 14:10 | history | edited | 200_success | CC BY-SA 3.0 |
edited tags; edited title
|
Apr 12, 2017 at 14:05 | review | First posts | |||
Apr 12, 2017 at 14:47 | |||||
Apr 12, 2017 at 14:02 | history | asked | Nerdrigo | CC BY-SA 3.0 |