ElchiYos / final-project

list of debtors at the grocery store
0 stars 0 forks source link

fields with fixed length can be declared as char [<LENGTH>] instead of char * #3

Open meni181818 opened 1 year ago

meni181818 commented 1 year ago

https://github.com/ElchiYos/final-project/blob/83350b527a939a9e9bc655d784ebd5a25b8c8fc0/final%20project/Debtors%20manager.h#L24 i mean id, and phone.

ElchiYos commented 1 year ago

In case the file has an invalid ID card with more than 9 digits. By the declaration with char* the software will be able to detect an error and display it.

meni181818 commented 1 year ago

you should read it to a temp buffer though. and not to the actual struck. and then do a validation to the temp buffer.