c programming

17 flashcardsby Haseeb1968
Study these flashcardsFree · spaced repetition · iPhone, Android, Mac & web

All cards

1
which library is used for file handling operations
stdio.h
2
use of fopen() and what does it return
it is used to open a file and it returns a pointer to the file
3
which function is used to close a file
fclose()
4
which function is ised to read from a file
fread()
5
use of fseek()
it is used to set the file position to a specified position.
6
use of feof()
It is used to check whether the end of the file is reached or not.
7
use of ftell()
It is used to get the current file position.
8
use of ferror()
It is used to check whether an error occurred during file operation or not.
9
use of remove()
It is used to delete a file.
10
use of rename()
It is used to rename a file.
11
what does the modes do in file
determines where the file is positioned when opeaned and what functions are allowed
e.g after you close a file you can reopean the file in different mode depending upon what you are doing e.g reading , writing or doing both simaltaneously in a file
12
what does this mode does in files "r":
Opens a file for reading. The file must exist.
13
what does this mode does in files "w"
Creates a file for writing. If the file already exists, it is truncated to zero length.
14
what does this mode does in files"a"
Appends to a file. Writing operations are always performed at the end of the file, regardless of the current file position.
15
what does this mode does in files "r+"
Opens a file for both reading and writing. The file must exist.
16
what does this mode does in files w+
Creates a file for both reading and writing. If the file already exists, it is truncated to zero length.
17
what does this mode does in files a+"
Opens a file for both reading and appending. Writing operations are always performed at the end of the file, regardless of the current file position.
Study all 17 cards for free