Well, you are trying to iterate ten times through an array that only contains 8 elements. You can use 'sizeof(members_list)/sizeof(members_list[0])' to calculate the number of elements at compile time. Just remember that it is only valid to do so with so-called "local-scope arrays". (Which is to say, arrays declared at or above the level that the sizeof(x)/sizeof(x[0]) expression appears).May I know what happen to my code when compile I get error ?
View attachment 301355View attachment 301356
Yes I overlooked that bit, didn't I? Thanks for the correction. (Serves me right for answering question before coffee!)View attachment 301403
The iteration looks like it goes over elements 0 to 9 in an array with 10 elements.
member_list[index]++;I think member_list contains some pointers to string variables and some uninitialised values. I don't know what the TS's intention is with the increment though. Maybe to change the pointer from pointing to person[n] to point to person[n+1]?You are trying to increment a string variable.