Posts

Showing posts with the label fwrite

Implementing Concept of Files, Linked List and Structures all together in C

C has always been a tedious task to learn.Understanding concepts with simple implementation, makes it easy for new programmers . Here , I am giving you the practical implementation for the Advanced C Concepts of Structures, File and Linked List  # include <stdio.h> struct employee {      int emp_code;      char emp_name[20]; }; struct slist {    int ecode;    char ename[20];     struct slist *next; }; struct slist *fp,*ep,*p,*temp,s; struct employee  emp; main() {    int ch;    FILE *fp1;    fp=NULL; // when the list has not been created yet, pointer to first node is set to NULL    ep= NULL; // Last Node Pointer also set to NULL    fp1=fopen("emp.dat","r");    if (fp1==NULL)    {         printf("Error Opening File");         getch();         return;     } //start readin...