“What if the parameter has the same name as a variable?”
int x = 3;
int pow(x) {
return x*x; // This will access the *argument* and NOT any variable. The more local variable gets priority
}
int main() {
pow(12);
return 0;
}Search
Jan 11, 20261 min read
int x = 3;
int pow(x) {
return x*x; // This will access the *argument* and NOT any variable. The more local variable gets priority
}
int main() {
pow(12);
return 0;
}