zoukankan      html  css  js  c++  java
  • C++第二章理论题经验整理2

    287.e2 is a valid floating-point literal.

    The range of floating-point numbers in C++: -3.4E+38 to +3.4E+38

    Float for single precision, double for double precision and long double for extended precision.

    Float store floating point numbers with 8 place accuracy and requires 4 bytes of Memory. Double has 16 place accuracy having the size of 8 bytes.

    setprecision(17)之后,搞出来的精度就是17位的。

    float i = 123.0f;
    cout << i << endl;

    上述代码输出的是123. (0f表示输出的精度)

    0.5f results in 0.5 to be stored in floating point representations.

    char types in C++ require atleast 8 bits and short requires atleast 16 bits, whereas for bool only 1 bit suffices and both int and float requires atleast 32 bits.

    The limit header holds the details of the machine dependent details.

    Each object in C++ is expressed in terms of char type and size of char type is one byte.

    32-bit systems:char:1 int:4 float:4

    Constructor creates an Object and Destructor destroys the object. They are not supposed to return anything, not even void.

    There are no void objects.

    enumerators are same as macros:Enumerators are used in order to create our own types whereas macros are textual substitutions.

    In C++, enumerations are stored as integers by the compiler starting with 0.

    Since enumerators evaluate to integers, and integers can be assigned to enumerators, enumerators can be assigned to other enumerators.

    Enumerator will allocate the memory when its variables are defined.

    If we not assigned any value to enum variable means, then the next number to initialized number will be allocated to the variable.

    Enumeration variable ‘star’ appears two times in main() which causes the error. An enumaration constant must be unique within the scope.

  • 相关阅读:
    ORM框架-SQLAchemy使用
    python与MySQL
    python 与rabbitmq
    阻止微信浏览器/QQ浏览器长按弹框“在浏览器打开”
    解决ios不支持按钮:active伪类的方法
    HTTP-FLV直播初探
    对比requirejs更好的理解seajs
    ‘true’==true返回false详解
    支付宝wap支付调起客户端
    JavaScript中基本数据类型和引用数据类型的区别
  • 原文地址:https://www.cnblogs.com/hhlys/p/13443538.html
Copyright © 2011-2022 走看看