fork download
  1. namespace B
  2. {
  3.  
  4. struct A{ int i; } ;
  5.  
  6. A getA(int i);
  7. }
  8.  
  9.  
  10. ::B::A ::B::getA(int i){ ::B::A a = {i}; return a;}
  11.  
  12. #include <cstdio>
  13. int main()
  14. {
  15.  
  16. ::B::A a = ::B::getA(2);
  17.  
  18. printf("%d\n", a.i);
  19.  
  20. }
Compilation error #stdin compilation error #stdout 0s 3340KB
stdin
Standard input is empty
compilation info
prog.cpp:10:1: error: ‘B’ in ‘struct B::A’ does not name a type
 ::B::A  ::B::getA(int i){ ::B::A a = {i}; return a;}
 ^
stdout
Standard output is empty