课堂笔记一

操作系统分为两类 :
非实时操作系统:
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;
}

   

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值