How would you use the functions fseek(), freed(), fwrite() and ftell()?



How would you use the functions fseek(), freed(), fwrite() and ftell()?..

Answer / Rahul Jha

In C, these functions are used for handling files.nnfseek(): This function is used to set or change the file position indicator for a stream. The file position indicator of a stream points to the next unread character in the stream.nnfreed(): There's no such function as freed() in C standard library, it seems like there might be a mistake in the question.nnfwrite(): This function writes data from an array of characters or from a string pointed to by a pointer to a stream. It returns the number of elements successfully written.nnftell(): This function returns the current file position indicator for a given stream as a long integer number of bytes.n

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

How do we declare variables in c?

1 Answers  


Which of the following are valid "include" formats? A)#include and #include[file.h] B)#include (file.h) and #include C)#include [file.h] and #include "file.h" D)#include <file.h> and #include "file.h"

15 Answers   Accenture,


5 Write an Algorithm to find the maximum and minimum items in a set of ‘n’ element.

1 Answers  


what is the output of the following program? #include<stdio.h> void main() { float x=1.1; while(x==1.1) { printf("\n%f",x); x=x-0.1; } }

6 Answers  


Explain how can I prevent another program from modifying part of a file that I am modifying?

1 Answers  


What are the basic data types associated with c?

1 Answers  


plz answer.. a program that takes a string e.g. "345" and returns integer 345

4 Answers  


how can u print a message without using any library function in c

1 Answers   NIIT,


main() { unsigned int k = 987 , i = 0; char trans[10]; do { trans[i++] =(char) (k%16 > 9 ? k%16 - 10 + 'a' : '\0' ); } while(k /= 16); printf("%s\n", trans); }

4 Answers   Vector,


What is a char in c?

1 Answers  


Why do we use header files in c?

1 Answers  


enum DAY { sunday, monday, tuesday }; enum EDAYS { friday, saturday, sunday }; void main() { int i =0; if( i == sunday) { printf("%d",i); } } what would be the output?

4 Answers   TCS,


Categories