initializacia

This commit is contained in:
Anton 2024-10-01 15:31:23 +02:00
parent f314b8479f
commit 3cbf4047a2

View File

@ -18,17 +18,8 @@ int read_pizza_list(struct pizza* list){
} }
} }
int read_item(struct pizza *item) { int read_item(struct pizza* list) {
static int currentIndex = 0;
if (currentIndex >= sizeof(menu) / sizeof(menu[0])) {
return 0;
}
memcpy(item, &menu[currentIndex], sizeof(struct pizza));
currentIndex++;
return 1;
} }