摘要: #include<stdio.h> #define N 10 int main() { int s,i,j,tmp; int a[10]={78,56,38,99,81,86,39,100,49,78}; for( i=0; i<10;i++) printf("%d ",a[i]); printf( 阅读全文
posted @ 2020-02-18 21:26 Tyrants 阅读(1154) 评论(0) 推荐(0) 编辑
摘要: 打印九九乘法表 #include <stdio.h> int main() { int n,i,j; for (i=1;i<=9;i++) printf("%-4d",i); printf("\n"); for(i=1;i<=9;i++) for(j=1;j<=i;j++) { printf("%- 阅读全文
posted @ 2020-02-08 20:45 Tyrants 阅读(2838) 评论(0) 推荐(0) 编辑
摘要: 自加运算符“++”的运算级别和运算符“*”的运算级别相同,按照自右向左的方向结合。 如: *p++,因为p++是后置自加,所以先取值再自加,所以表达式*p++相当于*p;p++;,即先取出p指针指向变量的值,再将指针p指向下一个存储空间。 (*p)++,表示将p指针指向的值取出进行自加。 阅读全文
posted @ 2018-08-05 10:36 Tyrants 阅读(2542) 评论(0) 推荐(0) 编辑
摘要: char a[][10]和char *a[]的区别: char a[][10]是一个二维字符串数组,每个字符串的字符数不超过10个;char *a[]是一个指针数组a,每个字符串的字符数不受限制。 阅读全文
posted @ 2018-07-23 16:41 Tyrants 阅读(168) 评论(0) 推荐(0) 编辑
摘要: int i; const int* p1=&i; int const* p2=&i; int *const p3=&i; 判断哪个被const了的标志是const在*的前面还是后面 p1、p2是同一种const,不能直接对*p赋值;p3不能进行p3++操作。 如:const int* p=&i; i 阅读全文
posted @ 2018-07-23 15:01 Tyrants 阅读(180) 评论(0) 推荐(0) 编辑