Parcourir la source

添加c语言

master
永攀 张 il y a 3 jours
Parent
révision
d58ce75182
1 fichiers modifiés avec 13 ajouts et 0 suppressions
  1. +13
    -0
      hello.c

+ 13
- 0
hello.c Voir le fichier

@@ -0,0 +1,13 @@
int add(int a, int b) {
return a + b;
}




int main() {
MathFunc f = add; // 将加法函数赋值给函数指针
int result = f(3, 5); // 通过函数指针调用加法函数
printf("3 + 5 = %d\n", result); // 输出:3 + 5 = 8
return 0;
}

Chargement…
Annuler
Enregistrer