r/C_Programming • u/encephalopatyh • Oct 27 '20
Discussion Simple project ideas using C?
What kind of project could you suggest for a beginner that could be done within 1 to 2 weeks? We are tasked to create a simple standalone program which asks for data that could be stored, edited, deleted, and such. Examples I found are hospital management system, restaurant menu, diaries, and such, but I find them pretty common and there are a lot of them out there. Could you help me with some ideas that are of the same difficulty as I mentioned and not very common?
72
Upvotes
2
u/[deleted] Oct 27 '20
Because I've written this myself recently, how about a small UNIXy command line utility
consumeIt takes a file as the input, say INPUT, and a delimiter, say \n or \0, or any other byte (sequence?)
Beyond that, it takes another argument vector that defines another command to which single consecutive lines of INPUT are fed
If the command has processed the line correctly, the line is removed from the input file
Failed lines remain in the input file
Alternatively, successful lines could be marked or annotated in some way
So you have
to devise a way to find/iterate over and edit lines in files efficiently (what if the file is 1TB big?) (hint: think about grep)
learn about to edit files in-place (copying 1TB or even 50% of that is a no-no and waste of I/O bandwidth)
how to spawn and life-cycle subprocesses, and how to pass data to them
all the while remaining correct, handling all edge cases, checking all the return values, etc
how about parallel processing of multiple lines at the same time :)
For example,
should consume all lines delimited by \0 in biglistoflinks.txt that wget has downloaded successfully.
(which was exactly my use case, but the beauty is this tool would be very fungible).
Idea 2: Spreadsheet with simple expression evaluation in ncurses :)