Hi everyone,
I think this is an easy question, I am just a bit rusty. I want to have an array of strings, each string 3 characters long. So I declare it as
If I am not mistaken, without parens this would be an array of 3 pointers to char, right?
OK so then I set aside some space for this array with:
Then, when I want to assign values to the array elements, I want to switch to the index notation (it is more convinient for the rest of the code), so I write:
Code:
name[index][3]=some_short_string;
But gcc complains, saying
Code:
"warning: assignment makes integer from pointer without a cast".
Well, yeah, I can understand how it can be seen that way, but what's the right way to do it? Even when I stick with the pointer notation and do
Code:
*(name++)[3]=some_short_string;
it gives me the same warning. Thanks for your help.