美文网首页
处理数据

处理数据

作者: 又起名字 | 来源:发表于2018-05-26 20:40 被阅读0次

    简单变量

    1.#include

    定义了符号常量来表示类型的限制 包含下面类似的语句行: #define INT_MAX32767

    2.int n_int = INT_MAX;

    int的最大值

    3.也可以使用字面值常量来初始化 :int uncles = 5; 注意顺序 uncles必须在最前

                                  int aunt = uncles; 

                                  int chairs = aunts + unles + 4;

    以上方法来自C语言,C++还有另一种初始化语法 :int owls = 101;

                                                  int wrens(432);

    C++11 初始化方式 :int hamburgers = {24};

                     int emus{7};  可以使用 = 也可以不使用

                       int rocs = {};

                      int psychics{];  大括号为空表示初始化为 0 

    4.sizeof 运算符产生类型或变量的大小

    5.#include

    如果超越了限制 , 其值将为范围另一端的取值

    6.cout << "cheat = " << chest << " (42 in decimal)\n"; //dec指示cout以十进制格式显示整数

    cout << "waist = " << waist << " (0x42 in hex)\n";      //hex指示cout以十六进制格式显示整数

    cout << "inseam = " << inseam << " (042 in octal)\n";    //oct指示cout以八进制格式显示整数

    相关文章

      网友评论

          本文标题:处理数据

          本文链接:https://www.haomeiwen.com/subject/akuujftx.html