Firstly I read a file and stored it into char array. Now I want to create a string array from char array with the help of getline function.
9/27/2018 8:36:37 PM
Sana Fatima1 Answer
New AnswerYou won't be doing it with getline as it doesn't allow specifying a buffer to process. I'd make a list of pointers to the start of each line and replace the '\n' with the '\0' needed to end a C string as you are reading in the file. One of the constructors for the string class accepts C strings so you could convert the easily.
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message