Advertisement
Guest User

Untitled

a guest
May 5th, 2015
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. // C program compiles & runs fine, even ; missing at end of struct
  2. #include <stdio.h>
  3. struct test
  4. { int a,b}; // missing semicolon
  5. int main()
  6. {
  7. struct test d={3,6};
  8. printf("%d",d.a);
  9. return 0;
  10. }
  11.  
  12. // Following is compilation error in C++
  13. #include <stdio.h>
  14. struct test
  15. { int a,b}; // missing semicolon
  16. int main()
  17. {
  18. struct test d={3,6};
  19. printf("%d",d.a);
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement