c++ - Reading a comma delimited file part by part -


i have assignment school , have read comma delimited file , put each value in char*.

ex)

file contains:

5,justin,19,123-4567,etc..  char * firstvalue = 5;  char * secondvalue = justin;  char * thirdvalue = 123-4567; etc.. 

i cannot use std::string since haven't learned yet. supposed ifstream or other file streams. have no idea how this

for homework assignments iterating on char array in loop , every time comma encountered splitting string work (i won't give code because exercise try work out yourself). real world use should aware csv format considerably more complex. consider multiline entries or entries escaped comma , how break above solution. recommend using libcsv real world csv parsing.


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

order - Notification for user in user account opencart -