Joined: Sat Apr 11, 2009 7:04 pm Posts: 1 Has thanked: 0 time Have thanks: 0 time
Hi everyone. I am newbie to this forum and I have some troubles with sorting names in c++. My code is: int main() { string name1, name2,name3; string store; cout<<"Enter name1\n"; cin>>name1; cout<<"Enter name2\n"; cin>>name2; cout<<"Enter name3\n"; cin>>name3;
system("pause"); return 0; ====================== when I run the program,and if I enter for example John,Bernard and Albert; I get Bernard,Albert,John. PS:I want to use only if statement like I tried it .No arrays. Could any one help me please?