Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. typedef struct
  2. {
  3. short s;
  4. int i;
  5.  
  6. struct Ss
  7. {
  8. short s;
  9. };
  10. } S;
  11.  
  12. error C2020: 's' : 'struct' member redefinition
  13.  
  14. typedef struct
  15. {
  16. short s;
  17. union U
  18. {
  19. int uu;
  20. };
  21.  
  22. struct S
  23. {
  24. short ss;
  25. };
  26.  
  27. union
  28. {
  29. int i;
  30. double d;
  31. };
  32.  
  33. } A;
  34.  
  35. A a = {1, 2, 3, 4};
  36. printf("A.s=%d A.uu=%d A.ss=%d A.i=%d n", a.s, a.uu, a.ss, a.i);
  37.  
  38. A.s=1 A.uu=2 A.ss=3 A.i=4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement