Hello all , i have a small problem , i'm writing now a voting program , and i'm a little bit confused , how can i attribute the votes to a certain person? i mean , i enter the value 1 , and this vote must go to the first person from the array. Here is the code . I'm a newbie , i have started to learn this programming language 1 month ago )
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
string users[3];
cout<<"Insert 4 names:"<<endl;
for(int i=0;i<=4;i++) {
getline(cin, users[i]);
}
getchar();
return 0;
}