#include <iostream>
#include <string>
#include <stdlib.h>

using namespace std;

const int SIZE = 30;

void changeName(string[], int);

int main(void) 
{ 	

	const int TOTAL = 5;;
	char students[TOTAL][SIZE];
	
	string students2[SIZE];
	students2[0] = "john";
	
	for (int i = 0; i < TOTAL; i++)
	{
		cout << "Enter name for student [" << i + 1 << "]: ";
		cin >> students[i];
		cout <<  endl;
	}
	
	//students[0][30] == "aaaa";
	
	for (int i = 0; i < TOTAL; i++)
	{
		cout << "Name of student [" << i + 1 << "]: " << students[i] <<  endl;
	}
	changeName(students, TOTAL);
	
	cout << students2[0];
		
    return 0;
}

void changeName (string students[], int total)
{
	students[0] = "Abu";
	students[1] = "Bakar";
	students[2] = "Ali";
	students[3] = "Baba";
	students[4] = "Samad";
	
	for (int i = 0; i < total; i++)
	{
		cout << students[i] <<  endl;
	}
}
