GithubHelp home page GithubHelp logo

16_c_train's Introduction

10.22 c语言培训

8:00 - 12:00

  • 面试五道题考察
  • 代码编写规范
    • 标识符命名规范:标识符只能由字母(AZ, az)、数字(0~9)和下划线_组成,并且第一个字符必须是字母或下划线
    #include<stdio.h>
    int main()
    {
        printf("Hello World\n");
        return 0;
    }
  • 顺序结构:
    • 基本数据类型
      • char, short, int, long int, float, double
数据类型 所占字节数 取值范围
short 2 -3276832767,即 -215(215-1)
unsigned short 2 065535,即 0(216-1)
int 4 -21474836482147483647,即 -231(231-1)
unsigned int 4 04294967295,即0(232-1)
long 4 -21474836482147483647,即 -231(231-1)
unsigned long 4 04294967295,即0(232-1)
  • 关系运算符
关系运算符 含义
< 小于
<= 小于或等于

| 大于 = | 大于或等于 == | 等于 != | 不等于

  • 逻辑运算符
运算符 说明
&& 与运算,双目,对应数学中的“且”
``
! 非运算,单目,对应数学中的“非”
  • 转义字符
    • \n, \t
  • i++与++i的区别
    • ++ 在前面叫做前自增(例如 ++a)。前自增先进行自增操作,再进行其他操作。
    • ++ 在后面叫做后自增(例如 a++)。后自增先进行其他操作,再进行自增操作。
    • 自减(--)也一样,有前自减和后自减之分。
    • 自增自减完成后,会用新值替换旧值,并将新值保存在当前变量中。自增自减只能针对变量,不能针对数字
  • 输入输出
    • getchar()putchar() : 字符的输入输出
    • gets()puts() : 字符串的输入输出
    • scanf()printf() : 可以输入输出各种类型的数据
数据类型 输出格式
int %d
long int %ld
char %c
float %f
double %lf
  • 常量
    • const int max = 100;
    • #define MAX 100 (宏定义)
  • 变量
  • 选择结构:

    • if-else语句
        if(判断条件)
        {
            //真 to-do
        }
        else
        {
            //假 to-do
        }
      
    • switch语句
        switch(表达式)
        {
            case 数字/单个字符:
                // to-do
                break;
            case 数字/单个字符:
                // to-do
                break;
            default:
                // to-do
                break;
        }
      
    • 三目运算符 : 判断条件 ? 真 : 假;
  • 循环结构:

    • while循环
        while(表达式)
        {
            // to-do
        }
      
    • do-while循环
      do
      {
        // to-do
      }while(表达式);  //do-while后面要加分号
      
    • for循环
        for(循环变量的初始化; 循环判断条件; 循环递增条件)
        {
            // to-do
        }
      
      • 什么时候用whlie或do-while:
        1. 循环次数不确定
        2. 循环的改变不是递增或递减
    • continue和break的区别
      • continue 结束本次 循环,进行下一次循环
        break 终止 循环不再进行
  • 数组:

    • 一维和二维数组
  • 函数:

    • 形参与实参

    • 递归的使用

  • 综合运用练习

19:00 - 22:00

  • 指针的简单使用

  • 结构体

  • 文件的简单使用

  • 综合练习(如果讲的完,带你们写写我去年的C语言小题库)

附加:

github的简单使用

markdown语法

16_c_train's People

Contributors

qiaoyunrui avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.