A pointer is a variable that has the memory location of an additional variable. The syntax is as shown below. You start by specifying the kind of data stored in the location recognized by the pointer. The asterisk tells the compiler that you are creating a pointer variable. Lastly you give the name of the variable.
Data type * variable name
Example:
int *ptr;
float *string;
No comments:
Post a Comment