课堂笔记一
来源:互联网 发布:黑白网络怎么关 编辑:程序博客网 时间:2024/04/29 19:15
操作系统分为两类 :
非实时操作系统:
Windows 1ms 不等分 0.5 for word procedure , 0.3 for mp3 , 0.2 for painting according to previledge
linux 塞班 民用方面
实时操作系统(RTOS)
微内核 代码很少 vx work(美国) QNX Itron(日本 (微内核, 代码很少)) MCOSII(教学用) 军事方面 优先级高的先运行 1ms for the whole task 硬件中断(立即对外部事件响应特别快)
Application
Middleware
Driver
Main 不是关键字,sizeof是关键字
C语言不允许以数字开头
#include <stdio.h>
#define NB "12"
int main(void)
{
char a[3] = "12";
int b = (int)a;
int c = (int)"12";
printf("%d\n%d", c, b);
}
#include <stdio.h>
#include <string.h>
#define N 10
typedef struct Student
{
char stuId[N];
char name[N];
int gender;
unsigned short age;
unsigned int scores;
} student;
int main(void)
{
student stu = {"20093287", "ying", 0, 19, 100};
printf ("%s\t%s\t%s\t%d\t%d\n",
stu.stuId, stu.name, stu.gender?"female":"male", stu.age, stu.scores);
strcpy (stu.name, "yun");
printf ("%s\t%s\t%s\t%d\t%d\n",
stu.stuId, stu.name, stu.gender?"female":"male", stu.age, stu.scores);
return 0;
}
#include <stdio.h>
#include <windows.h>
#include <conio.h>
enum sound
{
a = 262, b = 294, c = 330, d = 349,
e = 392, f = 440, g = 494
}var;
int main(void)
{
while (1)
{
switch(getch())
{
case '1':
Beep(a, 100);
break;
case '2':
Beep(b, 100);
break;
case '3':
Beep(c, 100);
break;
case '4':
Beep(d, 100);
break;
case '5':
Beep(e, 100);
break;
case '6':
Beep(f, 100);
break;
default:
break;
}
}
return 0;
}
#include <stdio.h>
int main()
{
int *p ;
int a = 0x12345678;
char *pa = (char *)&a;
for (int i = 0; i < 4; i++)
{
printf ("%x---%x\n", pa+i, pa[i]);
}
printf ("1\01");
return 0;
}
#include <stdio.h>
#include <string.h>
#define N 100
int encrypt(char *, char *);
int main()
{
char source[N];
char dest[N];
scanf("%s", source);
encrypt(source, dest);
dest[strlen(source)] = '\0';
printf(dest);
return 0;
}
int encrypt (char source[], char dest[])
{
int length = strlen(source);
int i = 0;
for (i = 0; i < length; i++)
{
if (source[i] > 'z' || source[i] < 'A')
{
dest[i] = source[i];
continue;
}
if (dest[i] >= 'w')
{
dest[i] = dest[i]-'w'+'a';
continue;
}
else if (dest[i] <= 'Z')
{
if (dest[i] >= 'W')
{
dest[i] = dest[i]-'W'+'A';
}
}
dest[i] = source[i]+4;
}
return 1;
}
- 课堂笔记一
- 课堂笔记(一)
- 课堂笔记一
- 嵌入式课堂--学习笔记一
- [课堂笔记]一.Java概述
- 看有心课堂笔记一
- 杰普课堂笔记(一)
- JAVA课堂笔记一 理论学习总结篇
- 机器学习课堂笔记(一)
- 课堂笔记
- 课堂笔记
- 课堂笔记
- 课堂笔记
- 课堂笔记
- 课堂笔记
- 课堂笔记
- 课堂笔记
- 课堂笔记
- 长按事件--UILongPressGestureRecognizer
- mini2440 SPI驱动移植 既自己总结的应用层的操作
- Unable to open log device '/dev/log/main' Huawai U8860
- 用对象图学习JavaScript
- 关于BL跳转指令只能在正负32MB范围内的解释
- 课堂笔记一
- java-玩家分的扑克牌
- 通过sql语句给F7过滤条件
- 常见的几种内容样式布局
- WordPress 插件开发教程 – Part-3 – 钩子( hooks )
- wince6.0 在flash上实现永久存储
- android ndk 调用第三方so
- xcode4.2/4.3 配置svn
- ROWID走索引不得其解之二