Topic 3, Applications to File Handling, C Function Libraries

24 flashcardsby Clement
Study these flashcardsFree · spaced repetition · iPhone, Android, Mac & web

All cards

1
Why is memory volatile?
Its contents are lost once the program is terminated.
2
What is a file used for in programming?
To store data that can be later retrieved and displayed either in part or in whole.
3
What are the main file operations in C?
Creation, writing, opening, reading, and closing a file.
4
Which function is used to write strings to a file in C?
fputs()
5
Which function is used to open a file in C?
fopen()
6
What are the three tasks fopen() performs when opening a file?
Searches the disk, loads the file into a buffer, and sets up a character pointer.
7
Which function is used to close a file in C?
fclose()
8
Which function reads characters from a file in C?
fgetc()
9
What does fgetc() return when the end of a file is reached?
EOF (End of File)
10
What file mode allows reading and writing but not modifying existing content?
"a+"

Function Libraries Flashcards:
---
11
What is a library function in C?
A built-in function grouped together in a common location called a library.
12
How are header files included in a C program?
Using the syntax #include<filename.h>.
13
Which header file contains input/output functions in C?
stdio.h
14
Which header file contains string-related functions in C?
string.h
15
Which header file contains common functions for C programs?
stdlib.h
16
Which function is used to print values to the screen in C?
printf()
17
Which function is used to read data from the keyboard in C?
scanf()
18
Which function writes an integer to a file in C?
putw()
19
What does the pow() function do in C?
Returns x raised to the power of y.
20
What does the sqrt() function do in C?
Returns the square root of a number.
21
Which function checks if a character is alphanumeric in C?
isalnum()
22
Which function converts uppercase letters to lowercase in C?
tolower()
23
Which function allocates requested memory in C?
malloc()
24
What does the exit() function do in C?
Causes the program to terminate normally.

Let me know if you'd like more flashcards or further adjustments!
Study all 24 cards for free