1. Hello! I'm new to C. I finished reading a beginning C book, and in the section about arrays, it says that one string can fit in a character array (char arrayname[]) but there cannot be a string array (string arrayname[]) that have multiple strings. Is that true?
Is
Code:
string arrayname[4] = {"one", "two", "three"};
not valid? My compiler lets me run it and it works, but why is the book saying it's wrong?
2. I know you can represent multiple strings in a character array by:
Code:
char newarray[10][4] = ("one", "two", "three");
because [10][4] indicates that there should be four newarrays created with a max of 10 characters each, but is
Code:
string multiplestrings[10][4] = ("i love you", "hello come to me", "i don't get C"; "hello world", "what are arrays"; "i am happy", "I am learning how to code");
valid? Does multiplestrings[10][4] basically create 4 string arrays that have a maximum of 10 different strings within each string array?
Thank you!