Fork()
I'm doing a OS class.
Trying to implement this pseudo code:
* Forking is fun! Simple tips
First, fork the child process:
pid_t ForkPID;
ForkPID = fork();
Then write a quick switch statement!
switch (ForkPID) {
// -1, fork failure
case -1:
printf("Error: Failed to fork.\n"); break;
// 0, this is the child process
case 0:
break;
// > 0, parent process and the PID is the child's PID
default:
}
I get an error:
ForkEnc.cc:18: error: stray ‘\302’ in program
ForkEnc.cc:18: error: stray ‘\255’ in program
line 18 is:
case -1:
can someone help me out.
drjay1627
Junior Poster in Training
91 posts since Nov 2008
Reputation Points: 12
Solved Threads: 1
drjay1627
Junior Poster in Training
91 posts since Nov 2008
Reputation Points: 12
Solved Threads: 1
i copied a code online from some MS power point slide. the ' in text files and in Microsoft applications are different. makes sense ever tried to write an email in word and copy it onto a gmail back in the day. you use to get weird character at '.
thanks ahamed101!
drjay1627
Junior Poster in Training
91 posts since Nov 2008
Reputation Points: 12
Solved Threads: 1