I'm trying to declare a pointer and allocate some space for it, but it's not working. What's wrong with this code?
char* p1,p2;
*p2 = malloc(10);
p2 is not declared as pointer. | |
the malloc output need to be cast to char* | |
assignment of pointer value into char. | |
syntax error |