ok so when i run this code:
for (size_t i = 0; i < arrayLength; i++)
{
if(gifts[i].ID[0]=='\0'){
return;
}
printf("%s | %s | %s | %s \n", gifts[i].ID, gifts[i].Gift, gifts[i].Name, gifts[i].Bought);
}
i get this output:
0 | TestGift | TestPerson | 01
1 | Random | RandomPerson | 1
which is almost correct, except of the 1 at the end of the first line, the gifts[0].ID is just '0', anyone has any idea why is this happening?
this is my Gift structure:
typedef struct{
char ID[2];
char Gift[100];
char Name[100];
char Bought[1];
}Gift;