Let's say I have something like this:
char *array,*mat;
array= (char*)malloc(BUFFER * sizeof(char));
fscanf("%s",array);
mat = (char*)malloc(strlen(array) * sizeof(char));
strcpy(mat1, strarr1);
So basically, I'm storing some text and then copying it over, but what happens if the original text is smaller than the BUFFER size? Does my original array occupy the size I allocated for it or does it only occupy the size of the string it contains?