tring to convert str string for use in std::getline delimiter

std::string::c_str() gives you a pointer to a character array. In order to fill a character array with the results of the call to c_str() you'll need to use strcpy() or strncpy() as those actually copy the C style string.

Also, you've declared delrr as an array of 1024 character pointers rather than 1024 characters, is that really the intent?


The third argument of getline() is a char, not a char array. See this. You cannot use this function if you need multiple delimiters or a delimiter made of multiple characters.

Use find() and substr().

Tags:

C++

String

Split