October 2011
Beginner to intermediate
1200 pages
35h 33m
English
You’ve been exposed to quite a bit of pointer knowledge lately, so let’s summarize what’s been revealed about pointers and arrays to date.
To declare a pointer to a particular type, use this form:
typeName * pointerName;
Here are some examples:
double * pn; // pn can point to a double valuechar * pc; // pc can point to a char value
Here pn and pc are pointers, and double * and char * are the C++ notations for the types pointer-to-double and pointer-to-char.
You should assign a memory address to a pointer. You can apply the & operator to a variable name to get an address of named memory, and the new operator returns the address of unnamed memory.
Here are some ...
Read now
Unlock full access