main()
{
FILE *fs;
char c[10];
fs = fopen(“source.txt”, ”r”); /* source.txt exists and
contains “Vector Institute” */
fseek(fs,0,SEEK_END);
fseek(fs,-3L,SEEK_CUR);
fgets(c,5,fs);
puts(c);
}
it prints ute.
SEEK_END moves the pointer to end of the file.
SEEK_CUR moves the pointer 3 places back(-3L). Nw the pointer is at u.
gets() tries to fetch 5 characters from the present position of pointer but can fetch only 3 characters as it reaches end of file.
puts() prints the characters i.e. ute.
Is This Answer Correct ? | 15 Yes | 0 No |
what is meant by flushll() in c programming?
a sequence of bytes with one to one corrspondence to those in the external device a) sequential addressing b) address c) byte code d) none
What is pass by value in c?
how many times does the loop iterated ? for (i=0;i=10;i+=2) printf("Hi\n");
Linked list is a Linear or non linear explain if linear how it working as a non linear data structures
What's a "sequence point"?
How can you allocate arrays or structures bigger than 64K?
How can I prevent another program from modifying part of a file that I am modifying?
What is the difference between array_name and &array_name?
will u please send me the placement papers to my mail???????????????????
How the C program can be compiled?
Between macros and functions,which is better to use and why?