Scratchpad

If you are new to Scratchpad, and want full access as a Scratchpad editor, create an account!
If you already have an account, log in and have fun!!

READ MORE

Scratchpad
Register
Advertisement


Theme: Programming

A computer can not understand your language. Neither it can understand C or any other computer language. So, how do we communicate with the computer? Its only true language is known as machine code. Unfortunately, it is very difficult to master. But, even for people who really know it, it is very unconfortable to use for practical purposes...

Programming comes in two main flavours: interpreted and compiled. When a program is interpreted, there is another program which scans it, line by line, and tells the computer what to do (in machine code). You need this external program, called the interpreter, so your program is not autonomous. Also, it can be pretty slow in some situations, since this external program has to make sense of your lines, and this may be a nontrivial task!

When speed is an issue, it's better to compile. This implies the use of another external program, called the compiler. This compiler converts your program in full into machine code. This process takes some time, but it is worth because, from now on, your program will run faster, and independently of the compiler.

This is what you do with the order g++ -o whatever whatever.cc: you compile your code, and the result --in machine code-- goes to the executable file.

Of course, there is much more to compiling than it has been exposed here... but it's OK for the time being. So, return to the Euler unit!

Basic programming

Advertisement