In this chapter, we discuss several pointers use cases, including the use of pointers as function parameters.
44.1 Pointers to Existing Objects
Pointers can point to
existing data objects using the address-of operator
&. Example:
int main(void)
{
char mychar = 'A';
char *p = &mychar;
printf("The pointed-to value is: %c\n", *p);
}
Output:The pointed-to value is: A
This example defines a variable of type char and makes the pointer point at that variable/data object using the & operator. The variable’s type char is matched by pointers char *