This is an example of code I've written:
string name = "";
string initials = "";
name = "First Second Third";
for(int i=0;i<name.length();i++){
if(name[i]==32){
cout << name[i+1];
initials=name[i+1];
}
}
cout << "\nYour initials are " << initials << ".";
My output is:
"ST"
"Your initials are T."
How do I save the 'S' and 'T' into my "initials" string?
I'm asking if this can be done without resorting to pointers, references, or std:: since I'm not familiarized well enough to begin using those concepts.