Sunday, April 10, 2011

Starting to program in C: Chapter One

In the following tutorials I'll show you an introduction to C, the programming language. I will rely on a very good tutorial published in daxhordes.org (web in spanish) by m0skit0. So we start with the first part:

For those of you interested in learning to program, I will be posting a small introduction to C, starting from scratch. No matter what OS you are using, the course will run both Linux and Windows (how generous I am!). If you like computers, consoles and video games, I advise you to learn to program, because once you learn, you'll enjoy very much.

C is an old programming language, bun he had a huge success. Possibly it's the most used programming language in the world, and has aged really well. It is primarily used to program operating systems due to its high flexibility. It is said that if someone doesn't know C, he can't say that he's a programmer. If he don't know assembler, he can't call him hacker. Let go then to the subject matter.

First, to program in C (and in almost all languages​​) must have a compiler. A compiler is a program that translates the code we wrote in C to zeros and ones that the computer can understand and execute. (see previous entry)

Installing C compiler

Linux 
We need to install build-essential package. This can be doing from your package manager easily (Synaptic in Debian and derivatives, etc ...). Also install a text editor that supports syntax highlighting, for example gedit in GNOME or kate in KDE. Not worth KWrite or OpenOffice or any word processor. With this we are ready.

Windows 
 In Windows we're going to download and install DevC++, a free compiler:


There we download Dev-C++ 5.0 beta 9.2 (4.9.9.2) (9.0 MB) with Mingw/GCC. It's important to download the version that comes with Mingw (the compiler). Once downloaded, we install it.

That's all for today. In the next chapter we'll build our first simple program (Hello World).  

No comments:

Post a Comment