fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. const int MAX = 4;
  5.  
  6. int main () {
  7. const char *names[MAX] = { "Zara Ali", "Hina Ali", "Nuha Ali", "Sara Ali" };
  8. for (int i = 0; i < MAX; i++) {
  9. cout << "Value of names[" << i << "] = ";
  10. cout << (names + i) << ' ' << &names[i] << endl;
  11. }
  12. return 0;
  13. }
Success #stdin #stdout 0s 5456KB
stdin
Standard input is empty
stdout
Value of names[0] = 0x7ffeb88ac420 0x7ffeb88ac420
Value of names[1] = 0x7ffeb88ac428 0x7ffeb88ac428
Value of names[2] = 0x7ffeb88ac430 0x7ffeb88ac430
Value of names[3] = 0x7ffeb88ac438 0x7ffeb88ac438