i have to make a Convert constructor that takes a string. This string will hold the integers as a string of characters, numbers are separated by the character |. For example, if the parameter is the following string “12|34|56|78”, the resulting object will have the following values: 12, 34, 56, and 78.
for(int i=0; i<8; i++)
{
if(s[i]!='|')
cout<<s[i]<<s[i+1]<<", ";
}
this is what ive done so far but the output i get is "12, |2, 34, |3.." how do i make it "12, 34, 56, 78" ?