I have read many topics regarding sort but i wasn`t able to sort them. I am new in C++. What changes i must do to sort the names alphabetically ?
#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;
class classroom
{
public:
string studentName;
void classroom::createStudent(string);
};
void classroom::createStudent(string name)
{
studentName=name;
}
int main()
{
//number of students
const int numstudents=10;
//create structure
classroom student[numstudents];
//initialize variables
student[0].createStudent("Alexa Trina");
student[1].createStudent("George Ali");
student[2].createStudent("Comina Riviera");
student[3].createStudent("Dimitri Askin");
student[4].createStudent("Erato Georgin");
student[5].createStudent("Georgina Mare");
student[6].createStudent("Konan Varvi");
student[7].createStudent("Lampros Anesti");
student[8].createStudent("Marina Parate");
student[9].createStudent("Nikon Smith");
return 0;//indicate that program end succesfully
}//end main
Thanks for you time!