2016 concepts title

Fill in the blank

  1. Where the program starts running from main () function ;
  2. Three control structures sequence , selection , cycle ;
  3. Value of a pointer can be initialized nullptr a (or NULL) , 0 , a specific address ;
  4. Properties less than other objects between objects depends on the specific operation is information hiding ;
  5. User-defined type is called an instance of the object ;

std :: cin, std :: cout, std :: cerr meaning

  • cin: istream object, used to complete the standard input from the input device;
  • cout: ostream object is the standard output stream outputted from the completion of the standard output device;
  • cerr: ostream object is the standard error output stream, without buffering, its content is sent to the output delay;
  • clog: ostream object is the standard error output stream, with a buffer, when the output buffer is full.

Storage class specifier What? What are their roles?

auto storage class

C ++ 11, auto keywords are two cases: the function return value placeholders type of the variable, the function declaration variables declared according to the initialization expression automatically inferred.

C ++ 98, auto keyword is used to declare an automatic variable in C ++ 11 have been removed such usage.

register storage class

Local variable definitions are stored in registers rather than the RAM, and such a case, the maximum size of the variable depends on the size of the register, and can not use its address operator (&).

static storage class

It instructs the compiler program held in the life cycle of the presence of local variables, memory allocation and release of memory does not require at each entering and leaving the scope thereof, can be used to maintain local variables.

At the same time, can also be used when modifying a global variable, the global variable modified, the variable scope limited to declare its files.

Another is to use the data members of the class action, it becomes static data members of the class, resulting in only a copy of the members of the class of objects shared by all.

extern storage class

For providing a reference to a global variable, the global variable for all the program files are visible. When using extern keyword does not initialize variables, only the variable name points to a previously defined through storage location.

mutable storage class

Suitable for objects of the class, mutable data members modified by const member functions.

* Operator Meaning

It has three meanings, namely, multiplication, and a pointer to the indirection pointer declarations.

What operator can not overload

The C ++ standard, not overloaded operators are: "." Generic relational operators, member pointer operator, the scope resolution operator "::" and the ternary operator "*." ":?." Member function must override operators are: assignment operator '=', remove the standard operator "[]", the member access operator "->" Operators and Functions "()."

C ++ to achieve polymorphism (with 2010)

Polymorphism refers to the result in different behavior of the same message is received different types of objects. From an implementation can be divided into multi-state polymorphic compile time and run. The former operation is determined during compilation of the same name specific operation target, mainly operated by a respective match the declared type, e.g. overloaded functions, the latter is dynamically determined before the specific operation for the object in the course of running , e.g. virtual functions, which is mainly achieved through virtual table.

Guess you like

Origin www.cnblogs.com/southernEast/p/12461626.html