views:

385

answers:

7

What are some good projects to work on in an effort to learn (or relearn) C? Ideally something akin to the assignments one might get in a class at university. Links to actual assignments/project specifications that are available online would ideal.

Note: they don't have to be assignments specifically from a C class or anything like that. Just the type of thing that would lend itself nicely to be implemented at a low level. Learning other interesting things at the same time is bonus!

If this question has already been asked somewhere, please point it out to me. The search terms I tried (class, assignment...!) weren't conducive to my searching as you can imagine.

+1  A: 

What type of apps do you know how to write? One option might be to grab a book like Charles Petzold's Programming Windows, read through and play with the example code.

(update) Miro Samek has authored a book targetted towards embeded development, "Practical UML Statecharts in C/C++". I really enjoyed the earlier version of the book, you may want to check it out.

Frank Schwieterman
The bulk of my experience is in boring CRUD-type web applications in Java/Python. But I currently work for an embedded software company and would like to make a lateral move one day.
Angela
This probably doesn't appeal to you, but I thought I'd throw it out anyway. I use a sudoku solver to learn new languages. There's also my 'catch-a-wumpus' game. The game can play against itself (another process).
yodaj007
hmm Win32 development is pretty different for embedded development, so my suggestion then is not so good. Dealing with fixed memory limits and whatnot is different than the Win32 world. That said you would get to practice C.
Frank Schwieterman
+8  A: 

I would recommend implementing the most commonly used data structures and algorithms like linked lists, trees, sorting, searching etc. They are short and insightful at the same time. If you knew the basics, go for the adavanced data structures and algorithms.

msvcyc
+4  A: 

Some ideas for larger programs. You said similar to class assignments, so they are educative but not very useful :-)

  • Create a simple shell, which can be used to start other programs. Implement pipes ("|"), background execution ("&"), sequential execution ("&"), conditional execution ("&&" and "||"). You will learn about the OS environment, process creation and communication between processes.

  • Implement some RFC defined protocol, like NTP. This will learn you networking programing, and they way to read and understand RFCs.

  • Implement a multi-threaded web server or an ftp server. This will learn you network programming, to deal with files and multi-threading.

In all cases, try to have performance in mind, from speed and memory usage point of view. Choose the best data structures and algorithms. That's the point of running C. After you are done, compare your solution with open source variants of the same. You will learn a lot. Also, run your programs in valgrind to check for memory errors.

tsg
+3  A: 

If you've got any interest in math, take a look at the problems on: http://projecteuler.net

Anon
+1  A: 

Here's the set of assignments I used last fall. The course was called 'computer architecture' but was really a course in machine-level programming. We got the title changed for the future. The course is the third in a required sequence, and students found it challenging.

Norman Ramsey
+1  A: 

Here's some assignments from a course I took last spring. They were very helpful and a good introduction to c. If you go to the schedule link at the top of that page, it will have all the class notes, which included a lot of code examples.

The assignments included a String data type, Symbol Table, Heap Manager, and a Unix Shell.

Evan
A: 
  1. Visit the CS website for your alma mater (or pick a decent tech school's site instead).
  2. Find the course page for a class that uses C.
  3. Do the assignments.
Curtis Tasker