Quick quiz:
What does the following code do:
char* p1, p2
?
Hopefully, you recognized that despite the fact that the asterisk is attached to the word char, we’re NOT creating two character pointers. Instead, we’ve created one pointer (p1) and one char variable (p2). Thus, the following are legal:
*p1 = 'C';
p2 = 'd';
p1 = &p2;
p1 = malloc(10*sizeof(char));