C Programming - Input / Output - Discussion
|
|
|
|
Read more:"Everything you can imagine is real."
- Pablo Picasso
|
| 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;
}
|
| [A]. |
Error: unrecognised Keyword SEEK_SET | | [B]. |
Error: fseek() long offset value | | [C]. |
No error | | [D]. |
None of above |
Answer: Option C
Explanation:
Instead of "20" use 20L since fseek() need a long offset value.
|
|
Kunal said:
(Thu, Sep 29, 2011 03:37:48 PM)
|
|
| |
| What is the use of fseek() ? |
|
|