学习日志 姓名:王俊 日期:7月13
|
|
今日学习任务
|
|
今日任务完成情况
(详细说明本日任务是否按计划完成,开发的代码量) |
|
今日开发中出现的问题汇总
|
今日无 |
今日未解决问题
|
无 |
今日开发收获 |
掌握了register,static,extern,const,typedef的使用,也掌握了 struct,union,enum;的使用; 结构体的作用时封装数据,打包数据; |
自我评价
(是否按开发规范完成既定任务,需要改进的地方,与他人合作效果等)
|
对编程还需多加练习; |
其他
|
无 |
#inclaude<stdio.h>
2
3 struct student
4 {
5 char sex;
6 char name;
7 int num;
8 double i;
9 };
10 typedef struct student sdt;
11 int main()
12 {
13 sdt p;
14 printf("sizeof(p) = %d\n",sizeof(p));
return 0;
16 }
#include<stdio.h>
2 #include<string.h>
3
4 struct student
5 {
6 int age;
7 char ch;
8 char ptr[50];
9 };
10 typedef struct student sdt;
11 int main()
12 {
13 sdt sd;
14 sdt * p_sd = &sd;
sd.age = 8;
16 // p_sd->age = 9;
17 sd.ch = 'n';
18 //p_sd->ch = 'v';
19 strcpy(p_sd->ptr,"hello world");
20 printf("sd.age = %d sd.ch = %c\n",sd.age,sd.ch) ;
21 printf("ptr = %s\n",sd.ptr);
22 return 0;
23 }