Что бы ты просто понимал. Там где read_contact : DEBUG это выводится как раз из структуры
if (strcmp(argv[1], "read") == 0)
{
Contact *contacts = NULL;
uint8_t count = read_contacts(contacts);
printf("[DEBUG READ FUNC] count = %d\n", count);
for (uint8_t i = 0; i < count; i++)
{
printf("\n\nloop init\n\n");
printf("%s | %s\n", contacts[i].name, contacts[i].phone);
}
free(contacts);
}
PS C:\Users\student\Documents\project\build> .\program.exe read
[DEBUG] fopen sucsess
[DEBUG] read count contacts: 2
[DEBUG] malloc sucsess
[read_string : DEBUG] Vars inited
[read_string : DEBUG] string: aryose
[read_string : DEBUG] Vars inited
[read_string : DEBUG] string: +111
[DEBUG] aryose | +111
-----------------------------------------
[read_contact : DEBUG] name = aryose
[read_contact : DEBUG] phone = +111
-----------------------------------------
[read_string : DEBUG] Vars inited
[read_string : DEBUG] string: test contact
[read_string : DEBUG] Vars inited
[read_string : DEBUG] string: +222
[DEBUG] test contact | +222
-----------------------------------------
[read_contact : DEBUG] name = test contact
[read_contact : DEBUG] phone = +222
-----------------------------------------
[DEBUG READ FUNC] count = 2
loop init
PS C:\Users\student\Documents\project\build>