Call by reference with pointer arguments
–Pass address of argument using & operator
–Allows you to change actual location in memory
–Arrays are not passed with & because the array name is already a pointer
–Pass address of argument using & operator
–Allows you to change actual location in memory
–Arrays are not passed with & because the array name is already a pointer
* operator
–Used as alias/nickname for variable inside of function
void double(int *number)
{
*number = 2 * (*number);
}
*number used as nickname for the variable passed
–Used as alias/nickname for variable inside of function
void double(int *number)
{
*number = 2 * (*number);
}
*number used as nickname for the variable passed
No comments:
Post a Comment