Hi everyone,
I gonna ask how to set unlimited size of array of characters. According to the tutorial that i have found after amount of time of googling, array size should be defined when we declare it. In my task requirement, i'm gonna need 2D array to store the value of characters.
E.g.
char inputText[ ][20]; //20 characters is the maximum for each line
In my case, i will put the user into an unlimited input of characters until certain rules are achieved. The problem that i encountered was, the above fragment of code always gives compilation error, it is said, the size of the array needs parameter whereas i do not want to define it.
if i change the code to
char inputText[ ][20]={ };
it gives Segmentation fault (core dumped) after i input the character. Any help would be appreciated. Thank you ^_^