What type of initialization is needed for the segment “ptr = ‘3’;” to work? = “Hello!”; c) both char *ptr = “Hello!”; and char ptr = “Hello!”; d) none of the mentioned

What type of initialization is needed for the segment “ptr = ‘3’;” to work? = “Hello!”; c) both char *ptr = “Hello!”; and char ptr = “Hello!”; d) none of the mentioned Correct Answer 3

Related Questions

Comment on the output of the following C code.
#include int main(){ char *str = "This" //Line 1 char *ptr = "Program\n"; //Line 2 str = ptr; //Line 3 printf("%s, %s\n", str, ptr); //Line 4}
Point out the error (if any) in the following C code?
#include #include int main(void){ int* p = NULL; struct S *s = NULL; void(*f)(int, double) = NULL; char *ptr = malloc(15); if (ptr == NULL) printf("Out of memory"); free(ptr);}