Sign In with GitHub…
New Snippet

C++

int main() {
	pid_t id = fork();
	
	if(id == -1) {
		std::cout << "Error creating child process\n";
		
	} else if (id == 0) {
		std::cout << "This is the child process\n";
		
	} else {
		std::cout << "This is the parent process\n";
		
	}
	
	return 0;
}