Closed claude-betz closed 6 months ago
We need to be able to pass in the address of a variable (pointer) as an argument to a function and modify the variable.
void modify_num(int *i) { *i = 2; } int main() { int num; num = 1; modify_num(&num); /* num = 2 */ }
We need to be able to pass in the address of a variable (pointer) as an argument to a function and modify the variable.