So, I have three array pointers of strings:
char *list1[3] = {"String 11", "String 12", "String 13"};
char *list2[3] = {"String 21", "String 22", "String 23"};
char *list3[3] = {"String 31", "String 32", "String 33"};
I need to access them based on the user input while running it. For example: If the input is 0, access list1 and so on.I figured I could make an array of these array pointers and it could work. This is what I tried:
char *ArrayList[3] = {*list1, *list2, *list3};
But when I tried to print ArrayList[0], ArrayList[1] and ArrayList[2], it just printed the first element of each list.
What am I doing wrong here?
*list1is equivalent tolist1[0].