Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
393 B
3
Indexable
#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>



int main(void){
	int fd[2];
	pipe(fd);
	char *buff = "Przemek";
	char *buff2 = malloc(sizeof(&buff));
	
	write(fd[1], buff, 11);
	close(fd[1]);
	
	printf("Buff nr 1: %s\n",buff);
	printf("Buff nr 2: %s\n",buff2);
	
	read(fd[0],buff2,11);
	close(fd[0]);
	
	printf("Buff nr 1: %s\n",buff);
	printf("Buff nr 2: %s\n",buff2);
	return 0;
}