Professional Documents
Culture Documents
Cheat Sheet
Cheat Sheet
//OTHER FUNCTIONS
i n t ∗ myIntPtrFunction ( i n t ∗ myIntPtr ) {
Don’t be fooled!
int a = 1 0 ; Sometimes the unary * is used to do a declaration and other times it is used as a
myNewIntPtr = &a ; dereference operator.
return myNewIntPtr ;
}
• If the unary * is used after a data type, it is a declaration
∗ ( bPtr + n ) ;
bPtr [ n ] ;
∗ ( b+n ) ;
i n t ∗ myIntArray [ 1 0 ] ;
int i ;
2293440
2293444
2293448
2293452
2293456
2293460
2293464
2293468
2293472
2293476
Notice that this method consumes 4 extra bytes (for the pointer).