Advertisement
apl-mhd

Pointer

Jan 25th, 2019
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <cstring>
  4. #include <cctype>
  5. using namespace std;
  6.  
  7. struct  list{
  8.  
  9.     string name;
  10.     string type;
  11.  
  12.       list  *node;
  13.  
  14. };
  15.  
  16. void dispaly(string& name){
  17.  
  18.  
  19.     name[0]='L';
  20. }
  21.  
  22.  
  23. int main() {
  24.  
  25.  
  26.     //line of string input
  27.    // char input[100];
  28.    // cin.getline(input,sizeof(input));
  29.  
  30.  
  31.  
  32.    int a=10;
  33.  
  34.    int *b; //pointer
  35.    int  **dbl; //pointer pointing
  36.  
  37.  
  38.    b = &a;
  39.  
  40.    dbl = &b;
  41.  
  42.    cout<<dbl<<endl;
  43.    cout<<&b<<endl;
  44.  
  45.    cout<<**dbl<<endl;
  46.  
  47.  
  48.  
  49.    cout<<&a<<endl;
  50.  
  51.    cout<<*b<<endl;
  52.    cout<<b<<endl;
  53.  
  54.  
  55.  
  56.  
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement