-->
当前位置:首页 > 题库

单选题:Using the program shown as following:

Luz5年前 (2021-05-10)题库874
Using the program shown as following: @[A](1)

```
#include
#include
#include
int value = 10;
int main() {
pid_t pid;
pid = fork();
value += 10;
if(pid == 0) { /* child process */
value += 5; }
else if (pid > 0) { /* parent process */
wait(NULL);
printf("PARENT: value = %d", value); /* LINE A */
exit(0);
}
}
```
Which string will be output at Line A?

A. PARENT: value =20
B. PARENT: value =10
C. PARENT: value =15
D. PARENT: value =25





A.PARENT: value =20
B.PARENT: value =10
C.PARENT: value =15
D.PARENT: value =25


答案:A