I have some basic knowledge of C (and a bit more of C++). I got a copy of K&R, and I want to use it to help me dig deeper into the language. What is a good idea that will involve using most of C's features and standard library? Also, what important differences between C89 and C99 should I be aware of?
EDIT: Forgot to mention, this should be mostly doable for a beginner. I'm not asking for a programming tutorial; rather, something mid-scale. I understand that OS stuff is one of C's main purposes, but wouldn't that be too complicated?
Also, reading and answering questions is always a good idea, but I want to get some actual practice, make a program that will do stuff.
From the menu bar, click File > New > Project. In the Select a wizard window, expand C/C++, select C++ Project, and then click Next. In the Create a C++ Project window, in the Project name field, enter a name for the C++ project. From the Project type list, select Makefile Project/Empty Project, and then click Finish.
Implement a programming language. This doesn't have to be terribly hard - I did the language that must not be named - but it will force you to learn a lot of the important parts of C. If you don't want to write a lexer and/or parser yourself, you can use lex/flex and yacc/bison, but if you plan on that you might want to start with a somewhat smaller project.
Take some program you have in a higher-level language and rewrite it. If you have a Perl/Python/Ruby/Bash script that you use a lot, and you notice a lag time while it runs, rewrite it in C with a focus on performance.
It's my opinion, however, that if you're writing a program to learn C, it's better to reinvent the wheel. Programming in C is all about making and adjusting the wheel, and if you only learn C by using libraries that abstract away the wheel for you, well, you're really not learning C. It may be faster - and when you're working on a real project in C, by all means, don't reinvent the wheel - but if you're doing this to learn, then by all means, learn how the wheel works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With