#include <iostream>
void change (int a)
{
a = 10;
}
void change (int *a)
{
*a = 10;
}
int main(int argc, const char * argv[])
{
int a = 5;
change(a);
std::cout<<a<<std::endl;
int * id = &a;
change(id);
std::cout<<a<<std::endl;
return 0;
}
时间: 2024-10-14 10:32:06