分类
Code

互联网应用 Lab

Lab 3

#include <unistd.h>
#include <stdio.h>

int main() {
    char *arg[] = {"/bin/ls", 0};

    /* fork, and exec within child process */
    if (fork() == 0) {
        printf("In child process:\n");
        execv(arg[0], arg);
        printf("I will never be called\n");
    }

    printf("Execution continues in parent process\n");

    return 0;
}
分类
Code

小学期完成

小学期。。。给我最深刻的启发就是。。。这辈子打死我都不做程序员。。。太TM累了。。。

分类
Code

Coursework 2015

Question

Write a program that will help elementary school pupils practice math.

a) The program will first ask the user for his/her ID number (including two letters & 4 digits), e.g.:

Please input your four digit ID no: AB1234
The program should have input validation.
Then the program prompts three choices:
* Start a test
* Check scores
* Exit

分类
Code

C语言 练习作业

EX01

EX01