fork(1) download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5.  
  6. struct foo {
  7. char str[3];
  8. };
  9.  
  10.  
  11.  
  12. int main() {
  13. foo s1 = {'a', 'b', 'c'};
  14. vector<foo> v;
  15. v.push_back(s1);
  16.  
  17. printf("%.*s\n", 3, v.back().str);
  18. return 0;
  19. }
Success #stdin #stdout 0s 5552KB
stdin
Standard input is empty
stdout
abc