C Programming - Input / Output - Discussion
Discussion Forum : Input / Output - Point Out Errors (Q.No. 3)
3.
Point out the error in the program?
#include<stdio.h>
int main()
{
FILE *fp;
fp=fopen("trial", "r");
fseek(fp, "20", SEEK_SET);
fclose(fp);
return 0;
}
Answer: Option
Explanation:
Instead of "20" use 20L since fseek() need a long offset value.
Discussion:
13 comments Page 2 of 2.
Tanya said:
1 decade ago
What is seek_set() ?
Babita said:
1 decade ago
fseek()
It seeks a specified place within a file and modify it
It seeks a specified place within a file and modify it
Kunal said:
1 decade ago
What is the use of fseek() ?
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers