First I need to mention that I learn c-codinghave been learning C coding for some time but would call memyself an intermediate beginner at best. So take what I say with the right amount of scepticism.
int MAXSIZE
To define constants like buffersizesbuffer sizes it is better to use const int which make your Intention more clearintention clearer.
Also you should be more consistenttconsistent with the spaces aorundaround your arithmetic operations:
forFor example, strlen(inputStr) - 1 is clearer than strlen(inputStr)-1.
You should be constant wihtwith the way you use functions and how you intend their arguments:
f(arg1, arg2) instead of sometimes f (arg1,arg2) and sometimes f ( arg1, arg2 )f ( arg1, arg2 ).
In Additionaddition to these Pointspoints, which will only improve the readability of your code, I am pretty sure that you could copy directly from Inputinput into the array like this:
/* allocate space in the array for the string and copy it in */
array[i] = malloc((sizeof(char*)) *(strlen(inputStr)) + 1);
strncpy(array[i], inputStr, strlen(inputStr) + 1);
This way you can delete the intermediate step where you save the input into a separatseparate string and allocate (and free!) memory for it.