Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- struct osoba
- {
- char ime[15];
- char prezime[15];
- int telefon;
- };
- struct osoba unos()
- {
- struct osoba *a;
- int i=0;
- printf("unesite ime: ");
- while(a.ime[i]!=' '||a.ime[i]!='\n')
- {
- a.ime[i]=getchar();
- i++;
- }
- a.ime[i-1]='\0';
- printf("unesite prezime: ");
- while(a.prezime[i]!=' '||a.prezime[i]!='\n')
- {
- a.prezime[i]=getchar();
- i++;
- }
- a.prezime[i-1]='\0';
- printf("unesite telefon: ");
- scanf("%d",&a.telefon);
- return a;
- }
- int main()
- {
- printf("Hello world!\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment