| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | Newsletters | VB Forums | Developer.com |
|
|||||||
| Algorithms & Data Structures Discuss algorithms & data structures. Topics are not specific to any programming language. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
ergent HELP required!
The following C program is run in a Linux environment. Analyse it carefully and answer the following questions
(using reference to the line numbers, where possible): 1: #include <stdio.h> 2: 3: int forkret; 4: 5: int main() { 6: printf(“Debug mesg A.\n”); 7: forkret = fork(); 8: switch( forkret ) ( 9: case 0 : printf(“Debug mesg B.\n”); break; 10: default : printf(“Debug mesg C.\n”); break; 11: } 12: return( 0 ); 13:} i) Concisely explain precisely what happens when line 7 is executed. ii) What are the possible values (and their significance) assigned to the forkret variable in line 7? very much approciated )
|
![]() |
| Bookmarks |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|