fork(1) download
  1. //data type 1
  2. typedef struct t_A{
  3. int mJ;
  4. }A;
  5.  
  6. //data type 2
  7. typedef struct t_B{
  8. int mK;
  9. }B;
  10.  
  11. //Function returning B object which is a rValue
  12. B funcRetB(void)
  13. {
  14. B test;
  15. test.mK = 9;
  16. return test;
  17. }
  18.  
  19. int main(void)
  20. {
  21. B b;
  22. b = (B)funcRetB(); //How to typecast this without defining a variable of B?
  23. return 0;
  24. }
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
Standard output is empty