A summary of a book

Source: Internet
Author: User

////

In ANSI C, the const modifier is globally visible, such as a const variable in a header file

C + + defaults all const adornments to static

////

The C-language bool was added after C99.

const char *p = ""; P is point to const char

*p is char;

const modifier char;

char Const *P = ""; P is point ro char const

*p is char const;

char * const p; Const P is point to char;; ((*P) (* const P))

* (const p) is char;

Bjarne a mnemonic method in his C + + programming language:

Read a statement from right to left.

char * const CP; (* read into pointer to) CP was a const pointer to Char

const char * p; P is a pointer to const char;

Char const * p; Ibid. because there are no const* operators in C + +, const can only belong to the preceding type.

The C + + standard stipulates that the Const keyword is placed before the type or variable name is equivalent.

Order

Base class constructs a member construction construct

Analysis of constitutive basis of constituent members

Strange.

void &a = 0; Err

Double &r = 0; Ok? I tried not to be OK.

int *p; int * &RP = P;RP = reference OK for a;//pointer
int a[1]; int & Ra[10] = a;//No reference to the array

No referenced reference, no reference pointer;

int & Rs[1] = A; Err

////

Reserved words do not necessarily appear in the syntax.

////

(++i) + (++J)
The calculation of this expression has two side-effects:
I self-increment 1;
J self-increment 1;
But which one happens first? The answer is: any answer is wrong.

////

For example, the following expression, as specified by the standard, does not define the result:
(i++) + (i++)

A summary of a book

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.