r/cprogramming • u/Steam_Liker_2002 • Oct 24 '26
Simple data management program
Hello, I programmed this simple data management program, it should be able to create, modify and remove data about workers. What do you think about it?
Here's the source code.
2
Upvotes
2
u/zhivago Oct 25 '26
I think you'd be better off using github, etc, and thinking of some specific questions to ask. :)
1
u/AcuityView Oct 25 '26
1] Who might need a program like this?
2] Why not use a simple database? It’s not strictly necessary, of course, but it’s with an eye toward the future. And if you ever need to add or remove a field, the file structure changes completely.
3] Why isn’t this moved into a separate function?
4] Actually, why do it this way, rather than using fputs or fwrite?
More questions than answers.
1
u/ACRM64 Oct 25 '26
It would be better to store the data in a relational database (like mysql or postgresql) or a nosql (json) database (like mongodb). At least use JSON or XML for your data files.
You don't need the \0 at the end of you strings in double inverted commas; that is added automatically.
1
u/Chrom0XD Oct 28 '26
Man, your program gave me megalophobia. Try splitting code into multiple files rather than dumping everything into one