Practical examples for practice C?

I know several programming languages, including Objective-C, Java, C # and python, and C. However, I need to increase efficiency in C.

In most languages ​​that are high-level, object-based, and GUI-oriented, I create some standard object-oriented examples to orient me to the language / framework. Usually I create an example of a “car” where I simulate a car and let the user adjust the speed by observing an increase in mileage.

However, something tells me that this example is not practical to port to C on the unix command line. What are some good basic ideas to “test yourself” in setting up C based on the unix command line?

Thanks for any input!

EDIT: Thanks for the answers. My main problem with the car example is that I should not try to object-oriented in this environment, but rather do what works best for the language. Thanks to Duck for offering to recreate the command line utilities.

+3
source share
5 answers

Restore (for the first time) any standard command-line utility - cat, ls, touch, more, less, etc. Write a base shell. They will execute C and re-familiarize themselves with unix system calls.

+4
source
+2

- . , Car, ( ). conio.h ncurses.h . . / .

+2

" Unix" . . , , C. ( ) .

This, IMO, would be better off clearing your C (in addition to revising K & R's oldie-but-goldie book.)

I highly recommend you go this route (in particular, if you come from a user interface, an object-oriented world). One world of caution: do not try to do OO in C. It can be done, but it is not. Learn how to program and model C code (in particular, with the examples configured for the purpose).

+1
source

All Articles