Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. struct save
  5. {
  6. char yestype[500];
  7. char nontype[500];
  8. };
  9.  
  10.  
  11. int main ()
  12. {
  13. struct save file;
  14. char ses[3][10] = { "hello", "etta", "smeets"};
  15. char crep[10] = "etta";
  16. for( int i = 0; i < 3; i++ )
  17. {
  18. if(!strcmp(ses[i], crep))
  19. strcpy(file.yestype, crep); break;
  20. if(strcmp(ses[i], crep) >= 1)
  21. strcpy(file.nontype, crep); break;
  22. }
  23. printf("yestype: %s\n", file.yestype);
  24. printf("nontype: %s\n", file.nontype);
  25. printf("crep: %s\n", crep);
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement