苏嵌//张奇哲//2018.7.23

学习日志                                       姓名:张奇哲        日期:7.23

 

 

 

 

今日学习任务

 

1 熟练掌握所有关键字的使用;(staticexterntypedef

2 熟练掌握复合数据类型的使用;(structunionenum

3C语言知识总结

 

今日任务完成情况

 

(详细说明本日任务是否按计划完成,开发的代码量)

  1. 举例学习了函数指针和函数指针数组
  2. 学习了staticexterntypedef等关键字的使用及注意事项
  3. 学习了复合数据类型包括:结构体、共同体、枚举的使用
  4. 举例完成了各项知识的学习

今日开发中出现的问题汇总

 

 

今日未解决问题

 

今日开发收获

今天学习了函数指针及函数指针数组的使用,并且同时复习了数组与指针 的相关知识。然后学习了之前并不是很熟悉的关键词的知识。和结构体,联合体,枚举的知识。弥补了自己知识上的漏洞。

 

自我评价

 

(是否按开发规范完成既定任务,需要改进的地方,与他人合作效果等)

 

 

C语言的学习到此就完成了,但是其中仍然有知识自己没能够掌握,需要进行巩固与提高,为最后的项目打下基础。需要继续进行训练。

其他

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

#include<stdio.h>

 

int add(int a, int b)

{

    return a + b;

}

int sub(int a,int b)

{

    return a - b;

}

int mul(int a,int b)

{

    return a * b;

}

int div(int a,int b)

{

    return a / b;

}

int cal(int a, int b , int (*p_cal)(int,int))

{

    return p_cal(a,b);

}

int main()

{

    int i;

    cal(5,6,add);

    cal(5,6,sub);

    cal(5,6,mul);

    cal(5,6,div);

 

    int (*p_cal_array[4])(int,int);

 

    p_cal_array[0] = add;

    p_cal_array[1] = sub;

    p_cal_array[2] = mul;

    p_cal_array[3] = div;

 

    for( i = 0; i < 4; i++)

    {

        (p_cal_array[i](5,6));

    }

    int sum = (p_cal_array[1](6,5));

    printf("the ressult is:%d\n",sum);

   // printf("p_cal_array[%d](5,6)=%d\n",i,*(p_cal_array[i]));

 

   

    return 0;

}

 

 

 

#include<stdio.h>

 

struct node

{

    char ch;

    char ch2;

    int num;

    int a[7];

};

 

typedef struct node Node;

 

int main()

{

    Node p;

 

    printf("the sizeof is:%d\n",sizeof(p));

 

}

 

 

 

 

#include<stdio.h>

 

union node

{

    int num;

    //char ch[2];

    char ch;

};

 

typedef union node Node;

 

int main()

{

    Node p;

    p.num = 0x123456789;

   // p.ch[0] = 0;

   // p.ch[1] = 1;

 

    //printf("the sizeof node is : %d\n",sizeof(p));

    //printf("p.num = %x\n",p.num);

    if(p.ch == 0x78)

    {

        printf("little!\n");

    }

    return 0;

}

 

 

 

#include<stdio.h>

 

struct message

{

    int a;

    char b;

   // char *p;

};

 

typedef struct message Message;

int main()

{

    Message msg;

    msg.a = 1;

    msg.b = 'h';

    //Message.p = #

 

    printf("a = %d b = %c\n",msg.a,msg.b);

    

    return 0;

}

 

 

 

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值