本周总结
2016-08-12 18:54
281 查看
本周总结
本周一开始学习了指针的定义,指针的类型,指针的实质是变量。(http://blog.csdn.net/qq_35576100/article/details/52153603)
本周二学习的是指针与一维数组的简单交集,二维数组也是相对与一维数组多个集合在一块的行数组。(http://blog.csdn.net/qq_35576100/article/details/52163753)
本周三学习了函数指针,函数指针的三部曲:复制函数名;抠掉函数名换成(*p)(xx);之后再调用函数指针传入参数。
(http://blog.csdn.net/qq_35576100/article/details/52174964)
本周四学习的是字符串的定义,字符串的多种定义方式,以及字符串的打印是直接打印函数地址就能直接打印出字符串。
(http://blog.csdn.net/qq_35576100/article/details/52184171)
输入字符串,用除api的方式进行判断
本周一开始学习了指针的定义,指针的类型,指针的实质是变量。(http://blog.csdn.net/qq_35576100/article/details/52153603)
本周二学习的是指针与一维数组的简单交集,二维数组也是相对与一维数组多个集合在一块的行数组。(http://blog.csdn.net/qq_35576100/article/details/52163753)
本周三学习了函数指针,函数指针的三部曲:复制函数名;抠掉函数名换成(*p)(xx);之后再调用函数指针传入参数。
(http://blog.csdn.net/qq_35576100/article/details/52174964)
本周四学习的是字符串的定义,字符串的多种定义方式,以及字符串的打印是直接打印函数地址就能直接打印出字符串。
(http://blog.csdn.net/qq_35576100/article/details/52184171)
#include<stdio.h> #include<Windows.h> /*逐一打印字符*/ void main(){ char str[] ={"I love U"}; char *p = str; while(*p){ printf("%c",*p); Sleep(1000); p++; } getchar(); return; }
输入字符串,用除api的方式进行判断
#include<stdio.h> int fun(char *p,char *p1,int a){ for(int i = 0;i<a;i++){ if(*(p+i)!=*(p1+i)){ return -1; } } return 0; } void main(){ printf("请输入两个字符串分别回车:"); char ch[1000] = "0"; char *p = ch; char ch1[1000] = "0"; char *p1 = ch1; scanf("%s",ch); scanf("%s",ch1); if(sizeof(ch)/sizeof(char)!=sizeof(ch1)/sizeof(char)){ printf("$ -1 $"); }else printf("$ %d $",fun(p,p1,sizeof(ch1)/sizeof(char))); getchar(); }
<span style="white-space:pre"> </span>//矩阵对角线之和
#include<stdio.h> int fun(int (*p)[3]){ int S = 0; for(int i = 0;i<3;i++){ S+=*(*(p+i)+i); } return S; } void main(){ int a[][3] ={{1,2,3},{4,5,6},{7,8,9}}; printf("矩阵对角线之和为%d",fun(a)); getchar(); return; }
#include <stdio.h> /*打印从大到小的三个数*/ int main() { int a,b,c,t; scanf("%d %d %d",&a,&b,&c); if ( a < b ) { t = a; a = b; b = t; } if( a < c ) { t = a; a = c; c = t; } if( b < c ) { t = b; b = c; c = t; } printf("%d %d %d",a,b,c); return 0; }
相关文章推荐
- 本周ASP.NET开发中的一点总结
- 本周总结
- 本周知识总结--5月11号
- IT第十天 - String和StringBuffer的比较、编程设计技巧整理、本周总结 ★★★
- 本周做Jquery Ajax+json+strut2实现二级级联查询总结心得
- IT第二十天 - 面向对象编程思想、抽象类、异常处理、程序操作日志记录、本周总结 ★★★
- 本周学习总结
- 本周对直立控制方案中直立控制的知识所学总结
- IT第五天 - 循环的使用、本周总结 ★★★
- 本周总结
- 本周实训总结和体会
- 1/10 本周总结
- 本周工作总结2012-03-15
- 本周进度总结
- 本周工作总结
- 本周工作总结(2008-11-17 ~ 2008-11-23)
- 对于本周的实训心得与总结
- 本周看代码找bug总结
- 本周做Jquery Ajax+json+strut2实现二级级联查询总结心得
- 本周的总结