0

The meaning of *& and **& in c++

What is the meaning of these pointers in c++ (*& and **&)

3rd Jan 2021, 11:44 AM
farkhondeh
2 ответов
+ 3
#include <stdio.h> int main() { int x = 5; int* px = &x; printf("%d\n", *&x); // 5 printf("%d\n", **&px); // 5 return 0; }
3rd Jan 2021, 12:22 PM
Flash
+ 2
another usage: #include <stdio.h> void dt(int*& x, int**& y) { *x = 50; printf("%d\n", *x); // 50 **y = 60; } int main() { int n = 5; int* a = &n; int** b = &a; dt(a, b); printf("%d\n", n); // 60 return 0; }
3rd Jan 2021, 12:40 PM
Flash