| New Reply |
A few questions about C programming language... |
Share Thread | Thread Tools |
| Feb23-13, 02:49 PM | #1 |
|
|
A few questions about C programming language...
1. In what direction does a compiler read a program? Left to right, top to bottom?
2. What does it mean when a function is called by another. Like when main() is called by the operating system, what is going on within the computer? Does the OS send a code in binary or what? 3. When the compiler hits "return 0;" does the program stop executing completely? Or does it continue to read the program from a different point? Thanks |
| Feb23-13, 03:42 PM | #2 |
|
Recognitions:
|
|
| Feb26-13, 11:49 AM | #3 |
|
|
I have the feeling the 3rd question may have been even more basic than rcgldr's interpretation of it:
1) The compiler does not stop upon encountering a return statement. It will just continue compiling until the whole code is compiled or errors are encountered. 2) The running program, when encountering a "return 0;" statement (more precisely: the code generated from the statement), will leave the current function and return zero to the function that called it. In that sense the program does indeed continue at a different point, afterwards. 3) In the case that the current function is "main", which itself is not called from another function, this implies that the program ends. |
| Feb26-13, 01:11 PM | #4 |
|
Admin
|
A few questions about C programming language... |
| New Reply |
| Thread Tools | |
Similar Threads for: A few questions about C programming language...
|
||||
| Thread | Forum | Replies | ||
| Best programming language? | Academic Guidance | 22 | ||
| Which programming language is best? | Academic Guidance | 12 | ||
| Recommended programming language (and texts) for middle-school beginner programming | Programming & Comp Sci | 9 | ||
| Programming language | Programming & Comp Sci | 10 | ||
| Which programming language do you use? | Academic Guidance | 20 | ||