指针
var a int = 2
var pa *int = &a
*pa = 3
fmt.Println(a)

★指针不能运算
参数传递
★值传递?引用传递?

void pass_by_val(int a) {
a++;
}

void pass_by_ref(int& a) {
a++;
}

int main() {
int a = 3;

pass_by_val(a);
printf("After pass_by_val: %d\n", a);

pass_by_ref(a);
printf("After pass_by_ref: %d\n", a);
}
Go语言使用值传递?引用传递?

★Go语言只有值传递一种方式

func swap(a, b *int){
*a, *b = *b, *a
}