[ create a new paste ] login | about

Link: http://codepad.org/3v4CpK5G    [ raw code | output | fork ]

C, pasted on Mar 21:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include<unistd.h>
#include<stdio.h>
int global=6;
int main(int argc,char**argv){
int var=10;
nt pid=fork();
if(pid==-1){
printf("error!");
}else if(pid==0){
global++;
var++;
printf("This is the child process!/n");
}else{
printf("This is the parent process! Child processed =%d/n",pid);
}printf("%d,%d,%d/n",getpid(),global,var);
return 1;
}


Output:
1
2
3
4
5
6
In function 'main':
Line 6: error: 'nt' undeclared (first use in this function)
Line 6: error: (Each undeclared identifier is reported only once
Line 6: error: for each function it appears in.)
Line 6: error: expected ';' before 'pid'
Line 7: error: 'pid' undeclared (first use in this function)


Create a new paste based on this one


Comments: