会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
梦里梦见梦不见的
博客园
首页
新随笔
联系
管理
订阅
上一页
1
2
3
4
下一页
2017年8月28日
c51延时
摘要: 延时有非精确延时和精确延时。 非精确延时: for(i=0;i<1000;i++); i=1000; while(i--); 精确延时: 库函数:-nop-(); //要引用头文件 #include <intrins.h> 用定时器,代码如下: #include <reg52.h>sbit LED=
阅读全文
posted @ 2017-08-28 13:56 梦里梦见梦不见的
阅读(259)
评论(0)
推荐(0)
2017年8月26日
51点亮第一个小灯
摘要: #include <reg52.h> sbit LED=P0^0;//sbit 小写 ,P必须大写 void main() { LED=0; while(1);//程序停止在这里 // while(1) //无限循环 // { // LED=0; // //} } 一般来说这样就可以点亮小灯了,但是
阅读全文
posted @ 2017-08-26 13:46 梦里梦见梦不见的
阅读(213)
评论(0)
推荐(0)
2017年7月12日
设计一个函数将一个数字字符串转换为数字,如将”1024”转换成1024输出
摘要: #include <stdio.h>int convert(char *str){ int k=0; while(*str!='\0') { k=k*10+(*str++)-'0'; } return k; } int main(int argc, const char * argv[]) { ch
阅读全文
posted @ 2017-07-12 09:04 梦里梦见梦不见的
阅读(324)
评论(0)
推荐(0)
2017年7月10日
结构体数组指针
摘要: #include <stdio.h> #define W 50 struct Students{ char name[20]; int sno; float yu; float shu; float ying; }stus[W]={{"zhao",0,20,99,97}, {"zhao1",1,97
阅读全文
posted @ 2017-07-10 14:01 梦里梦见梦不见的
阅读(152)
评论(0)
推荐(0)
2017年7月6日
共用体
摘要: 共用体 内存大小就是其中数据类型内存最大的内存大小。 #include <stdio.h> int main(int argc, const char * argv[]) { union uu { int a; double b; char c; }pp; printf("%d",sizeof(pp
阅读全文
posted @ 2017-07-06 11:33 梦里梦见梦不见的
阅读(87)
评论(0)
推荐(0)
结构体指针
摘要: #include <stdio.h> int main(int argc, const char * argv[]) { struct per1 { int a; double b; char b2; int a1; char b3; }per3; struct per1 *p; p=&per3;
阅读全文
posted @ 2017-07-06 11:26 梦里梦见梦不见的
阅读(117)
评论(0)
推荐(0)
结构体内存大小
摘要: 这只是作者自己的理解,读者看不明白请找其他资料。 #include <stdio.h> int main(int argc, const char * argv[]) { struct per { int a; double b; //内存大小:16 int a1; 8个内存地址前四个 char b
阅读全文
posted @ 2017-07-06 11:13 梦里梦见梦不见的
阅读(124)
评论(0)
推荐(0)
2017年7月4日
函数指针与指针函数
摘要: 函数指针:实质是指针 int (*zz) 有括号 指针函数:实质是函数 int *zz 无括号 返回值是地址 函数指针: int (*zz)();int wang(int a,int b){ return a+b;} int main(int argc, const char * argv[]) {
阅读全文
posted @ 2017-07-04 14:41 梦里梦见梦不见的
阅读(158)
评论(0)
推荐(0)
2017年7月3日
递归函数
摘要: 递归函数 : 函数调用本身。 列: 5的阶乘 :——》120 int mm(int a) { if (a<=1) { return a; } else { return mm(a-1)*a; } } int main(int argc, const char * argv[]) { int a=mm
阅读全文
posted @ 2017-07-03 12:08 梦里梦见梦不见的
阅读(195)
评论(0)
推荐(0)
2017年6月28日
空指针
摘要: int *p; p = NULL; int a; if (p != NULL) { *p = 100; } printf("%d",a); 空指针的作用:避免出现野指针。
阅读全文
posted @ 2017-06-28 16:21 梦里梦见梦不见的
阅读(126)
评论(0)
推荐(0)
上一页
1
2
3
4
下一页
公告