Proba 4
Never
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct { char name[30]; char surname[30]; char JMBG[14]; }Person; typedef struct { char brand[20]; char registration[10]; Person owner; }Car; void showbinary(FILE *inb) { fseek(inb, 0, SEEK_SET); Car x; while (1) { fread(&x, sizeof(Car), 1, inb); if (feof(inb)) { break; } printf("%s %s - %s %s %s\n", x.brand, x.registration, x.owner.name, x.owner.surname, x.owner.JMBG); } return; } void showcity(FILE *inb, char *a) { fseek(inb, 0, SEEK_SET); Car x; while (1) { fread(&x, sizeof(Car), 1, inb); if (feof(inb)) { break; } if (strncmp(a,x.registration,2)==0) { printf("%s %s - %s %s %s\n", x.brand, x.registration, x.owner.name, x.owner.surname, x.owner.JMBG); } } return; } void changeowner(FILE *inb) { char registration[10]; Person x; Car L; printf("Enter registration: "); gets(registration); printf("Enter the name of new owner: "); gets(x.name); printf("Enter the surname of new owner: "); gets(x.surname); printf("Enter the JMBG of new owner: "); gets(x.JMBG); fseek(inb, 0, SEEK_SET); while (1) { fread(&L, sizeof(Car), 1, inb); if (feof(inb)) { break; } if (strcmp(registration, L.registration) == 0) { L.owner = x; fseek(inb, (-1)*(signed)sizeof(Car), SEEK_CUR); fwrite(&L, sizeof(Car), 1, inb); fseek(inb, 0, SEEK_CUR); } } return; } int main(void) { FILE *inb; char a[3]; inb = fopen("automobili.bin", "rb+"); printf("Enter the city (NI, KV, BG...): "); gets(a); showcity(inb, &a); printf("\n"); changeowner(inb); printf("\n"); showbinary(inb); fclose(inb); printf("\n"); system("pause"); return 0; }
Raw Text
-
Aunt Judy's XXX - 60 Plus Busty Mature Teacher Nicole DuPapillon Fucks Her Student
10 min ago
-
V BUCKS GENERATOR 2024
14 min ago
-
CP😈 LOLI🍭👧 FOLDER💯📁 10GB
16 min ago
-
T33N S3X APRIL 19 2024 COLLECTION
29 min ago
-
Sex In Overdrive Maddy Black, Jennifer Mendez / Brazzers
40 min ago
-
Untitled
42 min ago
-
fhyfght
PHP | 1 hour ago
-
I sheltered my neighbor for the night, she paid me with anal sex
1 hour ago
-
CP💎 VÍDEO 😏 SLEEPING💤 TEEN GIRL 12yo🍭👧
1 hour ago
-
Adult Telegram Channels
1 hour ago