J
Jobs'R'Us
Hello,
Newbie has problem with array of structures using gcc on Linux Redhat 9...
The code:
struct { char mystring[50]; int myint; } mystruct;
int otherintvariable = 10;
for(int i=0;i < 20;i++)
{
mystruct.mystring[0] = 'a'; //trying to assign one character in a specific place
mystruct.myint = otherintvariable;
}
Both lines inside the for loop give compile errors with gcc:
"subscripted value is neither array nor pointer"
Please dumb it way down!
Thanks!
Kirst
Newbie has problem with array of structures using gcc on Linux Redhat 9...
The code:
struct { char mystring[50]; int myint; } mystruct;
int otherintvariable = 10;
for(int i=0;i < 20;i++)
{
mystruct.mystring[0] = 'a'; //trying to assign one character in a specific place
mystruct.myint = otherintvariable;
}
Both lines inside the for loop give compile errors with gcc:
"subscripted value is neither array nor pointer"
Please dumb it way down!
Thanks!
Kirst