1/47
Flashcards for reviewing C programming concepts, including arrays, sorting, searching, functions, and file handling.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
One-Dimensional Array
A data structure that stores elements of the same data type in a linear arrangement.
Two-Dimensional Array
A table of elements.
Three-Dimensional Array
A table within a table.
Bubble Sort
A sorting algorithm that repeatedly compares and swaps adjacent elements if they are in the wrong order, causing larger elements to 'bubble' to the end of the array.
Shell Sort
A sorting algorithm that compares elements that are far apart and then gradually reduces the gap between them.
Balloon Sort
Elements move toward their correct position faster than Bubble Sort. Instead of adjacent swaps, it might move larger elements directly toward their final position.
Linear Search
A searching algorithm where we start from one end and check every element of the list until the desired element is found.
Binary Search
An interval searching algorithm that searches for an item in a sorted list by repeatedly dividing the list into two equal parts.
Function
A program that will return a value unless declared as void; control first checks the main() function and then branches out to the other functions specified in the program.
Pre-defined functions
Programs imbedded in the C Programming Language that are ready to use.
User-defined functions
Programs created by the programmer for a special purpose.
Function Prototyping
Declaring a function before it is used in a program, telling the compiler the number and type of arguments and the return type.
Call by Value
Actual values are passed to the called function, and processing is done within the function until a return statement is executed. Changes do not affect the original values.
Call by Reference
The addresses of the actual parameters are passed to the called function. Any changes made to the variables in the called function affect the original variables.
strcpy(string1, string2)
Copies the content of string2 to string1.
strcat(string 1, string2)
Concatenates the content of string1 and string2; assigns the concatenated string to string1 and leaves string2 untouched.
strcmp(string1, string2)
Compares string1 and string2 and returns an integer based on whether string1 is less than, equal to, or greater than string2.
stricmp(string1, string2)
Compares two strings while ignoring cases.
strlwr(string)
Converts the string to lowercase.
strupr(string)
Converts the string to uppercase.
strchr(string,c)
Returns a substring of string beginning at the first occurence of character c up to the end of the string.
strlen(string)
Returns the length of the string. Null is not counted.
strrev(string)
Reverses all characters except the null terminator in the string.
isalnum(int ch)
Returns a non-zero if its argument is either a letter of the alphabet or a digit.
isalpha(int ch)
Returns non-zero if ch is a letter of the alphabet. Otherwise, zero is returned.
abs()
Returns the absolute value of the integer number.
ceil()
Returns the smallest integer represented as double not less than num.
fabs()
Returns the float absolute value of num.
floor()
Returns the largest integer represented as double not greater than num.
pow()
Returns base raised to the exp power (base, exp).
Pointer
A variable that holds the memory address of another variable.
Linked List
A dynamic data structure used to store a sequence of elements, where each element (node) contains data and a pointer to the next node.
Singly Linked List
. A self-referential structure that is made up of nodes that consists of two parts
Self Referential structure
Structures that have one or more pointers which point to the same type of structure, as their member
Structure
A collection of related heterogeneous fields.
Referencing structure elements
Accessing or changing the values inside a structure.
Structures Within a Structure
A structure within a structure where the main structure contains a structure from another structure definition.
Passing a Structure to a Function (Call by Value)
Passing the entire structure to a function, where a copy of the structure is used, and changes do not affect the original structure.
Pointers to Structures
Allows you to work with the memory address of a structure, instead of directly manipulating the structure itself.
File Handling
Storing data in a file with the help of a program.
Text Mode
Value written to the file is the actual sequence of characters.
Text Files
File contains data in the form of characters and is generally used to store a stream of characters.
Binary Mode
Value written to the file is converted into a sequence of bytes.
Binary Files
File contains data in binary form (i.e. 0's and 1's) instead of characters.
File Pointer
A reference to a particular position in the opened file, used to perform file operations.
fopen() Function
Opens a file and associates a stream with it.
File Opening Modes
Specify the allowed operations on the file to be opened; passed as an argument to the fopen() function.
File Handling Operators
Functions used to open, read, write, create, close, delete, or search for a file.