📜  c++ poitner - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:50.336000             🧑  作者: Mango

代码示例1
// A pointer in c++ is a variable whose value is a memory address. 

int main() {
      int x;      // 'regular' int
      int *y;     // 'pointer-to-an-int
  
    x = 5;      // assign x some value which is an integer
    y = &x;     // use the address-of operator to get the address of x;
                // store that value as the value of y. 
    return 0; 
}