fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. const char* first[] = { "g", "kuchbhikarlobhai" };
  8.  
  9. cout << "Address 0 =>" << &first[0] << endl;
  10. cout << "Address 1 =>" << &first[1] << endl;
  11.  
  12. auto* second = &first;
  13.  
  14. if(true)
  15. {
  16. const std::string temp1 = "idontknowwhatisa";
  17. const std::string temp2 = "slfjdslfkjdsf5fb";
  18.  
  19. if(true) {
  20. (*second)[0] = temp1.c_str();
  21. (*second)[1] = temp2.c_str();
  22. }
  23. }
  24. for (const auto& third : *second) {
  25. cout << "HI: " << third << endl;
  26. }
  27.  
  28. return 0;
  29. }
Success #stdin #stdout 0.01s 5284KB
stdin
Standard input is empty
stdout
Address 0 =>0x7ffdd4b90ad0
Address 1 =>0x7ffdd4b90ad8
HI: ���Z�U
HI: