mardi 24 mars 2015

Why is the type Char?

Why is the type of employees[0].position[5] a char instead of a string? I got this wrong on a test, and I can't figure out why... Appreciate your help.



struct Name
{
string firstName;
char middleInitial;
string lastName;

class EmployeeInfo
{
Name name;
int age;
int id;
string position;
public:
Name getName() { return name; }

EmployeeInfo employees[100];

Aucun commentaire:

Enregistrer un commentaire