short int PC = 0;
int main() {
foo(&PC) ;
}
void foo(short int PC) {
PC++;
}
How do I successfully update the global variable of PC?
Note: PC must be passed as a parameter and the global variable needs to be modified via the parameter.
As you can tell I am new to C and am trying to understand the difference between * and &. Any help would be much appreciated.
&PCnot having the typeshort int)