fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3. void fun(bool** pArr, int idx) {
  4. (*pArr)[idx] = false;
  5. }
  6.  
  7.  
  8. int main() {
  9. bool myArray[] = {true, false, true};
  10. bool *arrayOfPtrs[] = {myArray};
  11. cout << myArray[2] << endl;
  12. fun(arrayOfPtrs, 2);
  13. cout << myArray[2] << endl;
  14. return 0;
  15. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
1
0