fork download
  1. #include <iostream>
  2. #include <cstring>
  3. using namespace std;
  4.  
  5. void test(char **str)
  6. {
  7. cout << str[0] << endl;
  8. cout << str[1] << endl;
  9. }
  10. int main(int argc, char* argv[])
  11. {
  12. char a[2][5];
  13. strcpy(a[0],"abc");
  14. strcpy(a[1],"def");
  15.  
  16. char *str1[] = {a[0], a[1]};
  17. test(str1);
  18.  
  19. return 0;
  20. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
abc
def