I'm working on reducing some redundant code segments and ran across something that I'm curious about.
In my mod, I have 5 elements and initialize my array as <type> myarray[5] = {arg1, arg2, arg3, arg4, arg5}.
I reference it using a zero-based index and everything works just fine.
However, I ran across this snippet and can't figure out why it's coded this way.
Code:
const char *message_arg[9] = {0};
<...>
i = 0;
message_arg[i++] = message1;
message_arg[i++] = message2;
message_arg[i++] = message3;
message_arg[i++] = message4;
message_arg[i++] = message5;
message_arg[i++] = message6;
message_arg[i++] = message7;
message_arg[i++] = message8;
message_arg[i++] = message9;
Does this method assign the first value at index [0] or [1]? (If [1], will adding the string value to message_arg[9] throw an exception, or am I missing something?)
Each message# is passed as a parameter into the function.
Thanks!