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