0
Can someone please help me with this error? It shows an "invalid types 'char[int]' for array subscript" error.
// sets the student's gender with the char passed in void Student::setGender (char Gender) { for(int c = 0; c < 1; c++){ // we use t < 1 because Gender holds a one-character value gender_[c] = Gender[c]; } } // returns the student's gender string Student::getGender (void) { return gender_; }
2 Answers
+ 8
Hii Floyd Ack
So like in your gender[c], donât do that!
Since youâre passing in a char already, you donât have to do char[0]
Just do gender = Gender or something along those lines..
That might help!đ
+ 2
Thank you very much!