Chapter II Variables and basic types (1)

Source: Internet
Author: User

1, written in the second chapter before the words (personally think it is very useful)

    1. Programming language has some common features, built-in data types, expressions and statements, variables, control structures, functions;
    2. Then, it is provided to the user of the language, two ways to expand the above basic features:
      1. Allows programmers to define their own data types (such as class types)
      2. A standard library of languages, with standard functions and data types (nothing more than the type of class that a master writes, such as String,vector, etc.)
    3. In C + +, the type of a variable determines what actions the variable can perform, such as int a1 for integer variables, support + 、-、 *,/And so on
    4. Python is run-time only to check the type of variables in the statement
    5. C + + is a statically typed language, and at compile time, type checking
    6. No wonder, such as writing a Perl program a.pl and C + + program b.cc,
      1. Perl programs do not need to compile at all, directly run Perl a.pl,
      2. For C + + programs, you need to compile g++ a.cc, generate the executable a.out, and then run
    7. C + + is a static type of language resulting in the result that
      1. A C + + variable must first define a type, int, char, float, and then use the variable
      2. Perl and Python variables do not need to be defined before they can be used directly.
    8. The most important feature in C + + is: class
      1. The main purpose of C + + is to allow program apes to define their own types, and to make these types as easy to use as built-in types (int, float)
      2. C + + standard library, is a number of C + + experts, write some class types, these class type code is very sharp writing
    9. Therefore, we can summarize the learning route of C + +,
      1. The first is to learn basic grammar
      2. Then, learn to use the class type written by the master who wrote the standard library
      3. Then, learn how to write your own class type
      4. Therefore, the C + + primer This arrangement layout, is still very scientific.

Chapter II Variables and basic types (1)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.