1.指针做函数参数 示例: package main //必须有个main包 import "fmt" func swap(a, b int) { a, b = b, a fmt.Printf("swap: a = %d, b = %d\n", a, b) } func main() { a, b := 10, 20 //通过一个函数交换a和b的内容 swap(a, b) //变量本身传递,值传递(站在变量角度) fmt.Printf("main: a =…
# include <stdio.h> # include <stdlib.h> # include <string.h> # include <malloc.h> //创建一个结构体 typedef struct programmer { int salary; int experience; ]; } Programmer; void OneyearLater(Programmer *); int main () { Programmer p = {,…
#include<stdio.h> #include<stdlib.h> #include<string.h> int Funcadd(int a, int b) { return a + b; } int Funcplus(int a, int b) { return a - b; } int Funcmul(int a, int b) { return a * b; } int Funcdiv(int a, int b) { return a / b; } type…