#include <iostream> #include <conio.h> using std::cin; using std::cout; using std::endl; int main(){ cout << "http://dev-microsoft.blogspot.com/" << endl; cout << "C/C++ Exercise: array and pointer" << endl << endl; const int SIZE = 5; int number[SIZE] = {0, 1, 2, 3, 4}; cout << "address of &number[i] - " << endl; for(int i = 0; i < SIZE; i++ ){ cout << &number[i] << ":"; } cout << endl; cout << "accessed using pointer - " << endl; int *pnumber = &number[0]; for(int i = 0; i < SIZE; i++ ){ cout << pnumber++ << ":"; } cout << endl; cout << endl; system("PAUSE"); return 0; }
![C/C++ Exercise: array and pointer C/C++ Exercise: array and pointer](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVgdLOJg9S28Gc9iqcISEBC6pbslBhssqbahi2vFG9WxK8CqwopUAaNPP2Y5HX3mjhnCOeXRKT-UYPKhppAr-3kAJsK2x5xZIC8p00JkcIlHBbenuI6I0SBbh7Ul-tiUX4hceEm-C6SMc/s400/array_and_pointer.png)
No comments:
Post a Comment