Point out the error of the following code −
#include
#include
#include
int main() {
char* ptr;
*ptr = (int*)malloc(30);
strcpy(ptr, "ABC");
printf("%s", ptr);
free(ptr);
}
Answer: B
Here this makes integer from pointer, without a cast