Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- #include<string.h>
- struct Boo
- {
- char title[50];
- char author[50];
- int id
- };
- int main()
- {
- int result;
- struct Boo Book1;
- struct Boo Book2;
- strcpy(Book1.title, "AAA");
- strcpy(Book1.author, "TS");
- Book1.id = 45464;
- strcpy(Book2.title, "BBAA");
- strcpy(Book2.author, "MW");
- Book2.id = 457774;
- printf("Book 1 : T: %s A: %s ID: %d", Book1.title,Book1.author,Book1.id);
- result = strcmp(Book1.title,Book2.title);
- if (result == 0) printf("Strings are the same\n");
- if (result < 0) printf("Second string is less than the first\n");
- if (result > 0) printf("First string is less than the second\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement