fork download
  1. #include <iostream>
  2. struct foo {
  3. int bar;
  4. };
  5.  
  6. foo populate() {
  7. foo x;
  8. x.bar = 42;
  9. return x;
  10. }
  11.  
  12. int main() {
  13. foo y = populate();
  14. std::cout << y.bar << std::endl;
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
42