Hi all,
Here is my problem. I am just starting to program with C++ and i'm trying to figure out the best way to hold a character string compare it and then swap it to get an ascending order listing. So far I have this much:
Code:
for (int i = 0; i < arraysize; i++){
cout << "Please enter town name: " << endl;
cin.getline(name, arraysize, '\n');
strcpy(town, name);
town[strlen(name)] = '\0';
strcmp(town, name);
hold = town;
if (town[i] == '\0')
return 0;
return(town[i] - hold[i]);
cout << town << '\n';
cout << endl;
I am a beginner learning so any help would be greatly appreciated.