I am working on a queue data structure. The structure is:
struct queue
{
char array[MAX_LENGTH][8];
int back;
};
It is designed to store a list of MAX_LENGTH strings that are 7 chars long. I wish to push a 1D array of 8 chars (well, 7 chars and \0, just like the array in the struct).
I have this push code:
void push (struct queue *q, char s[]){
q->array[q->back] = s;
}
Which I figure might work, but apparently does not. In cl (.net's C/C++) compiler, I get the following error:
2.c(29) : error C2106: '=' : left operand must be l-value
gcc returns a similar error, on the same line (but I forget, and don't have access to gcc at the moment).
I'm fairly new to structs, and pointers so there's probably something very obvious I'm not doing. Appreciate any help :)