How to read line

let's say : string obj = "What is your name; age; 12";
which is stored in an array..

I want to read the element stored in obj separately using delimiter ';' and stored them separately in other different arrays.

Any methods like: getline (cin, str, ‘,’); ????

Sure...

1
2
stringstream ss("What is your name; age; 12");
getline(ss,str,',');
Thanks Athar.
Shouldn't that be...
getline(ss, str, ';');
?
@iHutch 105 : well I am looking for just the logic
Topic archived. No new replies allowed.