void SomeFunc(int someInt) //formal parameter called someInt
{
int someInt = 4; //also a local variable called someInt
cout << someInt << endl;
}
This one is not an error - compiler may or may not give a warning
1 2 3 4 5 6 7 8 9 10 11 12 13
class AClass
{
int x; //class variable called x
void ClassFunction(int x) //class member function with parameter called x
{
//which x will get used here (parameter or member variable)
//answer - the function parameter will get changed
x = 3;
}
};