C++2

Source: Internet
Author: User

1 References to Advanced

1 References to Advanced

Soft 1th question in interview

int (*z (int x, int (*y))) (int);

Z (int x, int (*y) (int)) to T

Int (*t) (int);

is a function call, the return value is a function pointer

X is a variable

Y is a function pointer

Z is a function, a parameter has a variable, there is a function pointer, the return value is a function pointer

Soft 2nd question in interview
Int (* & Z (int x, int (* & y) (int)))) (int);

Reference

1 #define_crt_secure_no_warnings2 3#include <iostream>4 using namespacestd;5 6 voidMain ()7 {8     inta[Ten] = {1,2,3,4,5,6,7,8,9,Ten };9     //the reference is to have an alias for the original variable, all the same addressTen     int(&ra) [Ten] (a);//Reference Array a One     inti =0; A  -      for(Auto Data:ra)//the cycle of c++11 -     { thedata = i +5; -cout << Data <<Endl; -     } -  +cout << a <<" "<< RA << Endl;//output address, up and down 4 of the same -cout << &a <<" "<< &ra << Endl;//output address, up and down 4 of the same +  ASystem"Pause"); at}

123

C++2

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.