What does actually happens with computer when we put a text programming code? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What does actually happens with computer when we put a text programming code?

I am wonder of physical and machine understanding. What computer thinks How does it process. At least suggest me some pdf file Thanks

17th Aug 2016, 10:46 AM
ghanashyam meher
ghanashyam meher - avatar
3 Answers
+ 7
There are 3 programs used to turn your code (called source code) into a program (.exe) the computer can run. The first is the preproccesor. This will scan the code for anything that needs files to help it run. When you start off coding, the most common use of the preprocessor is to get the files used for the iostream library. (This is why you type in #include <iostream>! It says "HEY! Include the files from iostream, I need them to work." The second is the compiler. The compiler takes your source code and the files from the preprocessor, and translates it into machine language instructions, which are those obj. files. This is why we need to make the right instructions (syntaxes) or else the compiler will get confused and won't be able to translate the code. If it finds a place it can't work properly, it will label it as a syntax error. The last part is the linker. The linker combines the object file together with a run-time library, which helps deal with things like the keyboard and mouse so you can interact with it. All of these in this order work so that it can make your code something the computer stores in the forms of on and off memory bytes (what we call 0s and 1s). It really is spectacular work, but none of it is magic, it's the combination of very dumb but powerful computers because of very smart but limited humans. When it comes to the actual physical reasoning, you'll need to ask around on a computer hardware engineering form, as it's a whole ballpark of it's own functions. A book to learn how it can work is "But How Do It Know?" which explains it in an wasy way to understand, plus it's pretty short.
17th Aug 2016, 3:30 PM
Dinoswarleafs
Dinoswarleafs - avatar
+ 3
The code we write is nothing the computer understand. So we need to use a compiler to convert our code to binary, or machine code. Bunch of 0 and 1.
17th Aug 2016, 11:26 AM
Andreas BeEm Kvist
Andreas BeEm Kvist - avatar
+ 2
nice answer, i think
19th Aug 2016, 1:59 AM
Miftah smartsystem
Miftah smartsystem - avatar