摘要:
在进行小项目学习IO前,先来一个类似于编程语言的hello world,也就是点灯和灯闪烁,来简单来调试一下硬件和软件编程环境。 点灯 #include "reg52.h" sbit LED1 = P3^7; int main() { while(1){ LED1 = 0; } } led灯闪烁 # 阅读全文
摘要:
1.文件编程练习1 实现linux cp命令的代码 #include<sys/stat.h> #include<fcntl.h> #include<stdio.h> #include<unistd.h> #include<string.h> #include<stdlib.h> int main(i 阅读全文
摘要:
1.文件编程概述 api open read/write lseek close 2.文件打开和创建#include<sys/types.h>#include<sys/stat.h>#include<fcntl.h> int open(const char *pathname,int flags)i 阅读全文
摘要:
#include<curses.h> #include<stdlib.h> #define UP 1 #define DOWN -1 #define LEFT 2 #define RIGHT -2 struct Snake { int hang; int lie; struct Snake *nex 阅读全文
摘要:
1.链表和数组区别及实现 #include<stdio.h> struct Test { int data; struct Test *next; }; int main() { int i; int arr[] = {1,2,3}; for(i=0;i<sizeof(arr)/sizeof(arr 阅读全文
摘要:
一.linux简介1.1和windows一样都是操作系统 都是多线程、多任务、多线程 1.2发行版 ubuntu fedora centOS 1.3linux内核 ios 安卓 1.4为什么要用它 开源/免费 为所欲为二.环境搭建2.1VMware安装2.2ubuntu安装 三.如何在linux下写 阅读全文
摘要:
由于个人的拖拉原因,时隔一周继续更新博客,记录学习。 一.结构体 1.1为什么要用结构体 1.2定义一个结构体 编程习惯要求大写开头 struct Student { int num; char name[32]; char sex; int age; double score; char addr 阅读全文
摘要:
因为一些身体的原因,连续几天的感冒和发烧,故多天只每天学习了一个小时不到,今天将这几天的学习整理在一起 一.字符串 1.1可以说就是字符数组 1.和整型一样 int data[] = {1,2,3,4}; 2.和整型数组一个道理--char str[] = {'h','e','l','l','o'} 阅读全文
摘要:
一.多维数组元素的地址 #include<stdio.h> int main() { int arr[3][4] = {{11,22,33,44},{12,13,15,16},{22,66,77,88}}; int i; int j; for(i=0;i<3;i++){ for(j=0;j<4;j+ 阅读全文