Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(void){
- //define a struct
- struct book{
- char id;
- int score;
- };
- //declare a struct variable b1
- struct book b1;
- //using dot to manipulate members.
- b1.id='1';
- b1.score=60;
- printf("id, %c\n", b1.id);
- printf("score, %d\n", b1.score);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement