In school, I had a teacher who once told me:
No statement could be truer. In standard C, a pointer is a variable whose value points to a location in memory. The problem with standard C is that this location in memory is not associated with a particular type. Instead, the pointer type itself defines the type of memory the pointer is pointing to, as in the following example:
int main(void){ int i; int *p = &i;}// > gcc scratchpad.c; ./a.out
In the previous example, we created an integer, and then created a pointer and pointed it at the previously-defined integer. We could, however, do the following:
int main(void){ int i; void *p = &i; int ...