每调用一次函数就增加1
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
void Func(int* x)
{
*x += 1;
}
int main()
{
int x = 0;
Func(&x);
Func(&x);
Func(&x);
printf("%d\n", x);
system("pause");
return 0;
}
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
void Func(int* x)
{
*x += 1;
}
int main()
{
int x = 0;
Func(&x);
Func(&x);
Func(&x);
printf("%d\n", x);
system("pause");
return 0;
}