Chat application in C using named PIPES
This is a simple set of two C Programs which can act as a chat application. Basically there are two programs which need to run simultaneously. One is the client program and other the server program. This core concept used behind this is FIFO, named pipes. Screenshots [Demo] Client Side Chat Terminal running the client output file Server Side Chat Terminal running the server output file The Code --> Receiver(Server) Side code //client_chat #include<stdio.h> #include<stdlib.h> #include<sys/stat.h> #include<unistd.h> #include<string.h> #include<linux/stat.h> #define FIFO_FILE "MYFIFO" int main() { FILE *fp; char a[40]; char readbuf[80]; start: if((fp=fopen(FIFO_FILE,"r+"))==NULL) { perror("fopen"); exit(1); } printf("Me : "); gets(a); if(a[strlen(a)-1]=='.') { fputs(a,fp); fclose(fp); ...