fork(1) download
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4. using namespace std;
  5.  
  6. int main() {
  7. vector<string> fooX = {"bar", "baz"};
  8. char *s = "bar";
  9. char *fooA[] = {"bar", "baz"};
  10. char fooB[][4] = {"bar", "baz"}; // why not 3?
  11. // char fooC[][] = {"bar", "baz"}; // compile-time error.
  12.  
  13. cout << s << endl;
  14. cout << fooX[1] << endl;
  15. cout << fooA[1] << endl;
  16. cout << fooB[1] << endl;
  17. return 0;
  18. }
Success #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
bar
baz
baz
baz