views:

225

answers:

10

Hello there, I'm new to programming and have been learning C for the past couple of months. I've covered most of the basics and would like to expand my knowledge. In order to get a bit more experience can you guys suggest some small projects that I can do? Things like image manipulation, gui, sending messages through the internet etc. Ive tried opening up a .jpeg file in notepad just to see what its "made of" so that i could manipulate it using C but failed miserably, reading this some of you may have laughed but could you point me in a direction:P?

Anything from tutorials to information on what files are made up of(lol),gui,sockets, windows registry etc would be helpful. Maybe a book even.

Any insight appreciated.
-Thanks.

+1  A: 

Try PNG, much easier. THere's even a SPEC you can read online. http://www.libpng.org/pub/png/spec/

start out just reading the headers, and determining the structure of the file. (how many chunks does it have, where are they located, how long are they? What kind are they) Then see if you can use a zlib library to decode some of the image streams.

Breton
A: 

If you want to learn how to do practical, useful things with a programming language, I would suggest trying out python. And if you're interested in manipulating files, python makes it realy easy to open them in binary mode and view a string or numerical representation of the bytes, mess around with said string or numbers, and convert back to bytes for writing a new file. I haven't used C, but python is fun for doing practical things really quickly. It also has a number of packages for that provide windows extensions and GUI toolkits if that's what you're into.

twneale
A: 

Find something that hasn't been done a million times already, and do it. And I'll probably be downvoted mercilessly for this, but take your C knowledge and move on to one of the C-derived languages (like C# or Java). In my opinion, working in C almost forces you to spend more time reinventing the wheel, or else it forces you to learn how to use libraries that aren't all that common or well-known. The more modern languages and platforms let you jump almost immediately to doing more interesting things that haven't already been done.

MusiGenesis
I agree and disagree. C/C++ are not good learning languages. But they are excellent languages. But I agree he should have a look at C# or Java first, that road leads to less frustration (and memory leaks)
Salgar
@Salgar: I enjoy working in C, but only for things like mathematical functions and the like. Creating a modern desktop application for Windows or Mac would be a nightmare in C (as compared to something like .Net) and I can't even comprehend the horror of trying to create a web app in C.
MusiGenesis
I'll be looking into java soon (its next on the list:), and with regards to c I want to know how libraries work..meaning how exactly gtk wxwidgets show up the way they do.
sil3nt
A: 

It sounds like you need a more fundemental understanding of things first. (I understand that's not as fun though)

In an attempt to explain why you can't edit a jpeg in notepad. Try having a look at this:

http://betterexplained.com/articles/a-little-diddy-about-binary-file-formats/

If you want to learn C/C++ specifically then I would either buy a book or read something like

http://www.cprogramming.com/tutorial.html

However C is not the easiest language to start learning with. If you want to just start getting programming practice, I would pick a language like C# and/or Java (in which GUIs are much simpler to make), and do something like create a tetris game (It is a good medium sized project that can make use of good Object Oriented language features)

Salgar
yes and hex editors, where do i start? been looking for examples on this but didn't find any in depth decent ones.
sil3nt
A: 

If you're interested in JPEG files or image formats in general, I would highly recommend Mark Nelson's The Data Compression Book. It assumes a working knowledge of C and progresses through a number of different data compression techniques, finally ending up with the basics of JPEG compression.

Greg Hewgill
+1  A: 

For (basic, very basic) image manipulation try PNM. You can create your own images in text and convert them to .jpg, .png, .gif, etc. with an image editor. Or create SVG files; they are text only too.

And for sending messages through the internet, read Beej's Guide to Network Programming.

Above all, have fun!

pmg
A: 

Rather than learning the basics of a new language, you would be better off applying what you already know to a useful project that actually does something. There are any number of examples, 15 Exercises to Know a Programming Language is as good as any.

Learning the syntax of a programming language is easy, applying it to problems is much more difficult and rewarding.

Dour High Arch
A: 

You can try your hand with a simple graphics application. Try drawing lines, circles and moving them around.

Ashwin
Up 1 if this was meant to be ironic . . .
twneale
A: 

Maybe take a look at the following books by Herbert Schildt:

  • Teach Yourself C
  • C: The Complete Reference

Both books come with nice code examples!

http://www.herbschildt.com/cpage.htm

A: 

Source code of an hex editor by a professional programmer (if you're on Mac OS X):

http://ridiculousfish.com/hexfiend/

(written in C / Objective-C )