Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- struct save
- {
- char yestype[500];
- char nontype[500];
- };
- int main ()
- {
- struct save file;
- char ses[3][10] = { "hello", "etta", "smeets"};
- char crep[10] = "etta";
- for( int i = 0; i < 3; i++ )
- {
- if(!strcmp(ses[i], crep))
- strcpy(file.yestype, crep); break;
- if(strcmp(ses[i], crep) >= 1)
- strcpy(file.nontype, crep); break;
- }
- printf("yestype: %s\n", file.yestype);
- printf("nontype: %s\n", file.nontype);
- printf("crep: %s\n", crep);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement