In the following why do the integer assignments work OK but the char assignment gives an error 'invalid array assignment'?
Code:#include <windows.h> #include <iostream> #include <string> #include <sstream> using namespace std; struct Player { char surname[5]; char initial[2]; char firstname[5]; char club[9]; int normalgrade; int rapidgrade; char gradingnumber[9]; int dmno; }; int main () { Player Reed; Reed.surname = "Reed"; //Reed.initial = "F"; //Reed.firstname = "Mike"; //Reed.club = "Fakenham"; Reed.normalgrade=200; Reed.rapidgrade=199; //Reed.gradingnumber="107456D"; Reed.dmno=14171; cout<<Reed.surname<<endl; cout<<Reed.rapidgrade<<endl; cout<<Reed.dmno<<endl; return 0; }



LinkBack URL
About LinkBacks




