Advertisement
touhid_xml

Structure in C

Jul 25th, 2015
543
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3.  
  4. struct Book{
  5. char c;
  6. int myNumber;
  7. };
  8.  
  9.  
  10. int main(){
  11.  
  12.     struct Book b1;
  13.     struct Book b2;
  14.  
  15.     b1.c = 'd';
  16.     b1.myNumber = 200;
  17.  
  18.     printf("The value of b1.c is: %C\n",b1.c);
  19.     printf("The value of b1.myNumber is: %d\n",b1.myNumber);
  20.  
  21.      b2.c = 'e';
  22.     b2.myNumber = 300;
  23.  
  24.     printf("The value of b2.c is: %C\n",b2.c);
  25.     printf("The value of b2.myNumber is: %d\n",b2.myNumber);
  26.  
  27.  
  28.  
  29.  
  30.  
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement