Contact me:

摘要: 让程序读入一组文本行,并打印最长的一行 ##getline函数理解 #include <stdio.h> int c, i; const int n = 99; char l[n]; main() { //处理一行 for (i = 0; (c = getchar()) != EOF && c != 阅读全文
posted @ 2020-11-28 15:53 impwa 阅读(119) 评论(0) 推荐(0) 编辑
摘要: • 数组变量本⾝身表达地址,所以 • int a[10]; int*p=a; // ⽆无需⽤用&取地址 • 但是数组的单元表达的是变量,需要⽤用&取地址 • a == &a[0] • []运算符可以对数组做,也可以对指针做: • p[0] ⇐=> a[0] • *运算符可以对指针做,也可以对数组做: 阅读全文
posted @ 2020-11-28 09:16 impwa 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 1 #include <stdio.h> 2 int k = 222, t = 9; 3 void swap(int *a, int *b); 4 5 main() { 6 swap(&k, &t); 7 printf("\nkkkkkk=%d\nttttttttt=%d", k, t); 8 } 阅读全文
posted @ 2020-11-28 08:57 impwa 阅读(143) 评论(0) 推荐(0) 编辑