fork 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 str = {{'a', 'b', 'c'}};
  14. foo str2 = str;
  15.  
  16. printf("%.*s\n", 3, str2.str);
  17. return 0;
  18. }
Success #stdin #stdout 0.01s 5384KB
stdin
Standard input is empty
stdout
abc