开发者

What are some practical projects to consider in trying to learn C?

I've seen a lot of questions and answers on SO about why I should learn C. I know that it's low level, it'll give me an understanding of how things work at that level, and it'll make me a better programmer. I know some good books to be reading to help me learn C.

What I don't feel like I know are some practical p开发者_运维百科rojects I can work on to help me learn how the language is used. There's a lot of examples in the books I'm reading, and they're absolutely useful as far as reinforcing knowledge gained about the language itself. But I don't feel as if I'm gaining any insight into "real life" examples of what I can do with C.

My background: I'm a recent college grad who's doing application programming in C#. I'm enjoying doing programming exercises in C -- but I just feel like they're exercises. I know obviously I'm not going to become an expert right away and start doing amazing things. I just want some ideas for things I can do to help me become better but that feel like more than just exercises. (I want to clarify that I'm not opposed to doing these kinds of tasks to help me learn about the language. I just think I'd get more excited about learning if I was doing something that seemed more practical in nature.)

If this is "not a real question," I truly do apologize, and I know questions about learning C are all over SO. I'm not trying to be repetitive. I'm sold on the idea that I should learn the language, I just want to be able to have some real ideas of how I can start applying the knowledge.

See Also

  • What is a good first C app to build, besides “Hello World”


Here's some ideas for you to try:

  1. Store a file containing hashes of every file in your music directory, and report on changes.
  2. Solve a Sudoku in the shortest possible time.
  3. Send a file using TCP to another computer. (Write both server and client).
  4. A program that broadcasts a list of public files (configured in a text file) over UDP, and then accepts TCP connections to download them.
  5. A command line POP3 client.
  6. Write a memory allocator, and hook into malloc.

Congratulations on deciding to learn C. It is the most powerful language on Earth, and will give you the foundation you need to kick some programming butt.


The way to learn C would be to try out POSIX compliant samples from any operating system book.


My seven step guide to finding something code wise to do :)

  1. find something you like or enjoy(preferably IT related)
  2. find a problem with it, or some way to improve it, else goto Step 1
  3. split the problem into logical parts, these will represent functions and structures, use a piece of paper if it helps you visualize the problem(this is what I some times do)
  4. devise your plan of attack, ie: how will you implement what you came up with in Step 3
  5. Code, Learn, Test, Learn, Debug, Learn, Improve, Learn and Code & Learn some more
  6. Done, but not really, this is when you review what you've made, marvel in all its glory, and learn from all its mistakes and problems. see what parts you enjoyed, what parts you hated and what parts you can still learn more from.
  7. goto Step 1, using the knowledge gained from Step 6 (and all the other steps along the way)

If you run out of things to do and want to be productive in a commercial sense, see if you can talk to people who work with computers/IT systems/etc as a daily occurrence in their job and see what happens them and try develop ideas that could improve their productivity and/or the ease with which they can perform their task(s), who knows, you may end up with some extra knowledge and some extra cash


See what are the things you enjoy doing in real life and try to use them in an application. For example if you like games, try to make a game or if you need an idea, remake a classic. If you like accounting, try to make an accounting application with a proper interface. If you are not passionate about the idea, then you'll probably get tired after a while and throw it away.

BTW, I think you're on a good path and I like the decisions you have made so far.


Write a compiler for a subset-of-C.


There are some Artificial Intelligence competitions that are both practical and fun. These will help you learn the language, encourage your understanding of any sample code, basic debugging and implementation of common algorithms.

Most importantly it's fun, so it keep will keep you motivated to keep learning.

For instance a few months ago I enjoyed the Google AI challenge: http://csclub.uwaterloo.ca/contest/

Good luck and enjoy :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜