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).  

Thursday, April 7, 2011

What exactly is programming?

Often the people don't stop to think what processes are happening on their computers. They just work, and nothing else, but the truth is that there're many things running smoothly, for example the hardware. All hardware parts are scheduled to work together, faultless, and this happens because a person (or more) has been thinking and programming everywhere.  
The set of programs that allow it to work properly is called software. I'm sure all of you have heard this word and know more or less what it means. But the software that governs the operation of the components of our PC isn't the only one. In addition, the software is the set of programs that allow people to interact with their computer components, for example, the internet browser running on an operating system, that allows us to interact with the global network.
All software is developed with a programming language. The computer programmers (coders) know any programming language who write and compile to create different applications that a computer can understand. I must add that electronic systems operate using a binary system, different decimal, hexadecimal, etc. very difficult to understand for a human, but the only one a machine can understand. It consists only of 0 and 1. More info here: http://en.wikipedia.org/wiki/Binary_numeral_system.

Unfinished post.