Category: C Refresh

24
May
2017

File Handling: Formatted Data Reading and Writing Example

code: #include<stdio.h> #define SIZE 80 int main() { FILE *fp; FILE *fpr; fp=fopen(“E:/nosemsters/codes/crefresh/crefresh/c_for_technical_interview_udemy_course/file pointer/frmt.txt”,”r”); if(fp==NULL) { printf(“unable…

24
May
2017

File Handling: Fprintf Write Content to a File

code: #include<stdio.h> #define SIZE 80 int main() { FILE *fp; FILE *fpr; fp=fopen(“E:/nosemsters/codes/crefresh/crefresh/c_for_technical_interview_udemy_course/file pointer/frmt.txt”,”r”); if(fp==NULL) { printf(“unable…

24
May
2017

File Handling: Take formated input from textfile using fscanf() function

code: #include<stdio.h> #define SIZE 80 int main() { FILE *fp; fp=fopen(“E:/nosemsters/codes/crefresh/crefresh/c_for_technical_interview_udemy_course/file pointer/frmt.txt”,”r”); if(fp==NULL) { printf(“unable to open…

23
May
2017

Read Content From a File using Fgets

code: #include<stdio.h> #define SIZE 80 int main() { FILE *fp; fp=fopen(“E:/nosemsters/codes/crefresh/crefresh/c_for_technical_interview_udemy_course/file pointer/chk.txt”,”r”); if(fp==NULL) { printf(“unable to open…

23
May
2017

Read Content from Text file using C

code: #include<stdio.h> int main() { FILE *fp; fp=fopen(“E:/nosemsters/codes/crefresh/crefresh/c_for_technical_interview_udemy_course/file pointer/b.txt”,”r”); if(fp==NULL) { printf(“unable to open file”); return 0;…

23
May
2017

File Handling in C

code: #include<stdio.h> int main() { FILE *fp; fp=fopen(“E:/nosemsters/codes/crefresh/crefresh/c_for_technical_interview_udemy_course/file pointer/a.txt”,”w”); if(fp==NULL) { printf(“Unable to open file\n”); return 1;…