c++ 指针1
                            
                            
                            #include <iostream>using namespace std;int main ()
{int  var = 20;   // 實際變量的聲明int  *ip;        // 指針變量的聲明ip = &var;       // 在指針變量中存儲 var 的地址cout << "Value of var variable: ";cout << var << endl;// 輸出在指針變量中存儲的地址cout << "Address stored in ip variable: ";cout << ip << endl;// 訪問指針中地址的值cout << "Value of *ip variable: ";cout << *ip << endl;return 0;
}
 
Value of var variable: 20
Address stored in ip variable: 0x7ffcfa0c2abc
Value of *ip variable: 20
                            
                        
                        
                        總結
 
                            
                        - 上一篇: c++ 指针
- 下一篇: c++ 递增一个指针
