#include <stdio.h>

/* Terry Harvey CISC105 Section 21 TA Aaron*/

/* Sample program about allocating an array  */

int main(){

    char temp[100];
    char* justEnoughSpace;

    scanf("%s", temp);

    //why plus one?
    justEnoughSpace = (char*)calloc( strlen(temp) + 1, sizeof(char));

    if (justEnoughSpace == NULL) 
        printf("error trying to allocate memory\n");

    strcpy( justEnoughSpace, temp );

    free(justEnoughSpace); //give back the space we allocated

    return 0;
}
