Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- int osoba_cmp (const void *va;const void *vb)
- {
- struct Osoba *oa=(struct Osoba*)va,*ob=(struct Osoba*)ob;
- return ???;
- }
- int main ()
- {
- char meno[100],priezvisko[100];
- struct osoba {char *meno,*priezvisko;};
- int i=0;
- while (scanf ("%s %s",meno,priezvisko)>0)
- {
- if (!strcmp(meno,"BYE")) break ;
- i++;
- }
- Osoba meno[100];
- qsort(meno,i,sizeof(struct Osoba),osoba_cmp);
- return 0;
- }
Add Comment
Please, Sign In to add comment