"Programmer's self-cultivation" in order to hello, world raises the question you know a few?

Category: C/C++ -> C++ Author: amis2009 Date: 2014-01-20 18:47:42
 
amis2009
2014-01-20 18:47:42

#include <stdio.h>

int main()
{
printf("Hello World\n");
return 0;
}


1. program Why should the compiler compiled before you can run?

2. compiler converts the C language program can execute machine code in the process do, how to do?

3. finally compiled executable file what is inside? In addition to machine code, what? How they are stored, how the organization?

4. # include <stdio.h> What does this mean? The stdio.h include it mean? C language library, what is? It is how to achieve?

5. different compilers (Microsoft VC, GCC) and different hardware platforms (x86, SPARC, MIPS, ARM), as well as different operating systems (Windows, Linux, UNIX, Solar), eventually compiling the results the same? Why?

6. Hello World program is how to run up? operating system is how loaded it? its execution from where to start, where to end? What happened before the main function? main function after the end of what has happened?

7. If no operating system, Hello World can run it? If you are on a machine with no operating system running on the Hello World What? Should be how to achieve?

8. printf is how to achieve? Why it can have a variable number of arguments? Why can the terminal output string?

9. Hello World program at run time, it is in memory of what it was like?
ainiaiqing
2014-01-20 18:49:48
1. program Why should the compiler compiled before you can run?

, ,

2. compiler converts the C language program can execute machine code in the process do, how to do?

。 ,

3. finally compiled executable file what is inside? In addition to machine code, what? How they are stored, how the organization?

, , , , 。
Windows PE Linux ELF  ,


4. # include <stdio.h> What does this mean? The stdio.h include it mean? C language library, what is? It is how to achieve?

stdio.h C , , 。
C C , printf 。
C C 。 ,, strcpy

5. different compilers (Microsoft VC, GCC) and different hardware platforms (x86, SPARC, ; MIPS, ARM), as well as different operating systems (Windows, Linux, UNIX, Solar), eventually compiling the results the same? Why?

。。 。。。 ( )。。 , ,

6. Hello World program is how to run up? operating system is how loaded it? it from where begin, where to end? What happened before the main function? main function after the end of what has happened?

, , 。
C/C++ main , , , 。
main , 。 VC , main ,
TC, main 。main 。

7. If no operating system, Hello World you can run it? If you are on a machine with no operating system running on the Hello World What? Should be how to achieve?

。。
jmp helloworld 。。( OS)
, 《 》, hello world
[/code
8. printf ? ? ?
[code=C/C++]

<stdarg.h>
2a8e40506848.png 。。
,,
, google printf 。。

9. Hello World program at run time, it is in memory of what it was like?



finalterminal
2014-01-20 19:04:02
you asked the question regarded the computer's basic problem. Look at the proposals upstairs depth understanding of computer systems this book, starting with the general understanding about operating systems.
about you these questions, the compiler can run the machine in order to become a binary file. There is also a binary file format, different platforms may not be the same. But divided into the code segment, data segment, etc., can be loaded into memory, the operating system is also off-page memory management, so to facilitate memory management. Include the header file in the link, it will hide the header file with the code linked into an executable program, this place has dynamic linking and statically linked in two ways.
compiled executable program under linux and windows should format there are still differences. In general, or organize data by segment. No operating system is certainly not implement it. Before executing the operating system may create a process, allocate memory space, and then enters the main function bar.
you more problems, or more reading, the future will understand. Some I forgot to say it may not be right, in short, much more reading.
inchtown
2014-01-20 19:21:12


course, it is necessary otherwise you will always stay in just learning how to use stages
piaolankeke001
2014-01-20 19:30:38
I have that book read, read dozens of pages and then I felt very difficult to see
mermaid50234
2014-01-20 19:34:34
Relying on Ourselves, if the landlord really want in-depth understanding of computer programming when we do something, I suggest you buy a copy "In-depth understanding of computer systems", you can google it, it is a classic textbook.
sofia1986
2014-01-20 19:42:26
see you later what direction, I feel these are embedded aspects
fkety
2014-01-20 20:00:08
to crowd about, your question is if we do not know the language very difficult to answer.
A10017111
2014-01-20 20:11:42
so ga! Good question!
lingduyu36
2014-01-20 20:21:12
Several years later, to see if I can answer
woshiwangshuo1
2014-01-20 20:26:13
If you follow zhao teachers often posted thankful learning sequence, at the end, these issues should be a small case
qkl123
2014-01-20 20:37:25
I also bought this book also learning. The depth of their research really makes me admire. I also work with that direction. . About those questions. Probably just a really detailed understanding to say, can not say a few. . . So it is not nonsense.
xysjw222
2014-01-20 20:44:32
LS refers to the bar. . Haha
computer composition principle → DOS command → assembly language → C language (not including C + +), code written specification → data structures, compiler theory, operating systems → computer networks, database theory, regular expressions → other languages ​​(including C + +), architecture ......

English is a computer language says.

's advice to learn programming:
eye over a thousand times better to hand over again!
books to read thousands of lines than to knock his hand!
hand knock thousand lines as single-step line!
single step thousand lines of source code than the corresponding single-step assembly line!
queen17520
2014-01-20 21:00:03

+1. landlord does require very familiar with the operating system, but also in our daily life will not go too noticed the problem about these can be encoded with more in-depth understanding of
bdq06081301
2014-01-20 21:25:25
This book is good, but to be honest that is not deep ah, university foundation courses to learn the reads no problem ah
seaunboy
2014-01-20 21:55:51
That book is a university foundation course materials
If you feel a deep hard, or it is not a computer professional, or is the university foundation courses Meihuahao
xiaoyunhexiaowei
2014-01-20 22:16:02
Well, the landlord refueling. . .
szxa005
2014-01-20 22:50:02
hee hee. . Saw depth understanding of computer systems. . . Seemingly able to answer a few questions
zhaikaiqiu
2014-01-20 23:09:52

+ +
xiaoyi787
2014-01-20 23:45:39
Zhao teacher is calendar harm

Page 1 of 4    «  »