How do I use the GNU toolchain to learn C programming?
I am new to programming, and even newer to Linux. I was told that Linux is the best OS to learning to program as it lets a programmer interface closely with th开发者_Go百科e machine architecture. I heard a lot about the GNU tool-chain and that it provides the best programming environment on Linux so I decided I won't use an IDE and put in as much time is needed to learn things the right way.
I have just finished installing Ubuntu 10.10. I installed Vim and started learning to use it for my text-editor. Also I have been able to verify that GCC and GDB are present on my system. I am learning to program in C from the book - Computer Science: A Structured Programming Approach using C. Though it explains how editor, compiler, linker and runner are used to develop and run programs, it doesn't explain how to set them up and use them. So my question is, once I have the source-code written in my text-editor, how do I invoke the GNU tool-chain to compile and run my program.
save it with some name, e.g. filename.c and then call gcc and invoke the binary (named a.out by default)
gcc filename.c
./a.out
精彩评论