I'am a student who has just started C++ and for practice I'am writing a simple game.
I have checked the archives and found nothing pertaining to this.
If a user enters improper data such as a number or nothing I want to correct it.
struct player
{
char firstName[ArSize];
int score;
};
player* plyr=new player[numPlyrs];
while (cin.get(plyr.firstName,ArSize))
Here is what I tried.
Any type of input is accepted.
When I use that test condition with an array it works so I would imagine it has something to do with the array of structures.
Any help would be appreciated.
Thank you.
I have checked the archives and found nothing pertaining to this.
If a user enters improper data such as a number or nothing I want to correct it.
struct player
{
char firstName[ArSize];
int score;
};
player* plyr=new player[numPlyrs];
while (cin.get(plyr.firstName,ArSize))
Here is what I tried.
Any type of input is accepted.
When I use that test condition with an array it works so I would imagine it has something to do with the array of structures.
Any help would be appreciated.
Thank you.