Home > Back-end >  A simple pointer problem
A simple pointer problem

Time:06-03

 
Fun test (void * TMP)
{
//in the main function calls the function test and the test function can only accept a void * TMP pointer parameter, how to use the pointer in the TMP to modify the main function of the value of the variable a, which is the main function in a=2 modified into a=3
}
Int main ()
{
Int a=2;
The test (& amp; a);
}

CodePudding user response:

Using pointer
Void test (void * TMP)
{
If (TMP) {* (TMP) (int *)=3; }
}

CodePudding user response:

Fun test is what mean?

CodePudding user response:

The bai and invented a new grammar

CodePudding user response:

I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html
  • Related