AusbauKlaus
Sachsen, Germany
 
 
:steamfacepalm:
Sedang Offline
Komentar
SachsenLarve 16 Jan @ 10:55am 
💙💙💙💙💙💙 NUR OSSIS können das LAND retten 💙💙💙💙💙💙💙
SachsenLarve 16 Jan @ 10:54am 
#include "lib_functions.h"
#include <inttypes.h>

void add_book(char *title_p, char *author_p, int16_t *price_p, int16_t *bookcounter_p){

printf("\nBuchtitel?: "); scanf("%s", title_p); scanf("%c"); //scanf's 2nd parameter is the adress of the variable to store in,
printf("Autor?: "); scanf("%s", author_p); scanf("%c"); //that's y the pointers are given directly
printf("Preis?: "); scanf("%d", price_p); scanf("%c");
*bookcounter_p += 1; //*bookcounter_p++; seemingly doesn't work
}

void show_list(int16_t *bookcounter_p, book_t *books_p){
for(uint8_t i = 0; i < *bookcounter_p; i++){
printf("\nBuch %d: %s von %s, (%d Euro)\n", (i+1), books_p .title, books_p .author, books_p .price);
}

}