malloc works with int but not with strings
Advertisements Im a very new to C language. Im trying to learn about to memory allocation with the next examples. If I allocate memory for a integer like this: int* pint = (int*)malloc(sizeof(int)); if (pint == NULL) { printf("NULL pointer!"); } else { *pint = 5; printf("el valor es: %d", *pint); free(pint); } This show… Read More malloc works with int but not with strings