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.

  • 相关阅读:
    零售行业解决方案一
    N-Tier Entity Framework开源项目介绍
    软件代码生成之Codesmith模板.netTiers
    ActiveMQ消息队列介绍
    EntityFramework动态多条件查询与Lambda表达式树
    GitLab版本管理
    REST服务介绍
    2014年物联网Internet of Things应用简介
    wordpress如何屏蔽wp-json(禁用REST API)
    bootstrap tab切换如何让鼠标移动自动切换内容
  • 原文地址:https://www.cnblogs.com/hhlys/p/13443538.html
Copyright © 2011-2022 走看看