//testMalloc.c //John T. Rine //October 24, 2011 #include #include int main(int argc, char **argv) { //malloc a char array char *arrayPTR = NULL; arrayPTR = malloc(sizeof(char) * 10); printf("The address contained in arrayPTR before assigning a string is: 0x%x\n", arrayPTR); arrayPTR = "John Rine\0"; printf("The address contained in arrayPTR before assigning a string is: 0x%x\n", arrayPTR); printf("My name is: %s\n", arrayPTR); //free(arrayPTR); return 0; }