online resource

What is the best online resource to learn C programming. I want to learn C like the programming guru's out there. I would greatly appreciate if you can help me understand what is the best method to learn programming.

Knowing the syntax of a language doesn't make one a good programmer, there is something more to it than that. I want to get to the bottom of the puzzle I have been having.



  • : Thanks for the reply Darius and yes although I am just starting out any information you can give me relating to the said files would be helpful. By the way I dont make a habit of deleting things I was just experimenting and at my stage in programming it would`nt exactly take long to rewrite my program(know what I mean).

    Okay. Then if rsrc is what I think it is, then it should be a plain text file holding Windows resources. Open it up in a text editor and you should get a general idea of how it works. You'll have to check the documentation you should have for the format as I really don't want to write everything out here, and like I said, you rarely need (or want) to modify these by hand. rsrc.o is just rsrc compiled with a resource compiler, I believe windres may be the program that does it using GNU tools. I don't use GCC for Windows GUI developement. You can also likely compile it through the gcc program.

    So now you have two "object" files. Making a program is broken into two parts by most compiled languages. Compiling and linking. Compiling does the vast majority of the work and (as you know) it's the part that reads in what you type and generates the machine code to do it, however, the output of compilation is not an executable, instead you get an object file. A linker takes an object file as input and generates the executable. So, why bother with this round about way o fdoing things? Mainly so that you can put multiple pieces together at the same or different times. Scenario) You break your program into two source files, when you compile them you want one executable, not two. If the compiler produced executables then this would be a problem. So what you do is you link the two object files together. Now you want to change the second source file. Without object files you'd have to recompile both files, if it took a long time to compile those files this could get very frustrating. Now you add need another routine, but you think FORTRAN is the language to use for it. Since object files are language independent you can combine your FORTRAN routine with the other three files, just by linking the object files (okay it might take a slight bit more work, but nothing obscene). Now your friend thinks he's a hot shot programmer and he can figure anything out. You make up some interesting routine that you want him to play with and see if he can figure out how you got it to do whatever it does. You want him to be able to compile the routine in his own programs so he can test it out and try stuff with it, but you don't want to give him the source code because then he could just read it and see how you got the effect. So, you give him the object file containing routine. Now he has the routine, but he doesn't have the source code.

    That was a quick example of various situations where object files are useful, the last one is somewhat contrived because I like open source software and I didn't want to push the "real-world" analagous use of selling object files while keeping the sourcecode hidden. Library files (.a, .lib) are just collections of object files (literally). Library/object files are what hold the machine code, don't fall into the trap that so many beginning C/C++ programmers seem to of thinking that header (.h) hold the functions. Header files are (in a sense) the table of contents to the library files. When you include stdlib.h that signals the compiler to also link in the standard library (not it won't automatically link in libraries you made), it's not that stdlib.h has the functions in it.

    "We can't do nothing and think someone else will make it right."
    -Kyoto Now, Bad Religion

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion