1/71
Flashcards for reviewing C programming concepts from lecture notes, focusing on arrays, sorting, searching, functions, strings, characters, math functions, pointers, linked lists, structures, 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, accessed through an array index starting at 0.
Two-Dimensional Array
An array that is like a table of elements, represented as
Three-Dimensional Array
An array that is like a table within a table, represented as
Bubble Sort
A sorting algorithm that compares adjacent elements and swaps them if they are in the wrong order, with larger elements 'bubbling' to the top.
Shell Sort
A sorting algorithm that sorts elements by comparing elements far apart and gradually reducing the gap between them.
Balloon Sort
A sorting method where elements move toward their correct position faster than Bubble Sort.
Linear Search
A sequential searching algorithm that checks every element of the list until the desired element is found.
Binary Search
An interval searching algorithm that repeatedly divides the sorted list into two equal parts and searches for the item in the relevant part.
Function
A program that returns a value unless declared as void; the main() function is the entry point.
Pre-defined functions
Programs embedded 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, specifying the number and type of arguments and the return type.
Call by Value
A function call where actual values are passed to the called function, and changes made in the called function do not affect the original values.
Call by Reference
A function call where addresses of actual parameters are passed, allowing changes in the called function to affect the original values.
strcpy(string1, string2)
Copies the content of string2 to string1.
strncpy(target, source, count)
Copies count characters from string source into string target.
strcat(string 1, string2)
Concatenates the content of string1 and string2; assigns the concatenated string to string1 and leaves string2 untouched.
strncat(string1, string2, count)
Concatenates no more than count characters of string2 to string1 and assigns the concatenated string to string1.
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.
strncmp(string1, string2, count) or strnicmp(string1, string2, count) or strncmpi(string1, string2, count)
Compares no more than count characters for the two strings, ignoring cases in strncmp() and strnicmp().
strlwr(string)
Converts the string to lowercase.
strupr(string)
Converts the string to uppercase.
strnset(string,c,count)
Sets the first count character of the string to the value of c.
strset(string,ch)
Sets all characters in the string to the value of ch.
strchr(string,c)
Returns a substring of string beginning at the first occurrence of character c up to the end of the string.
strlen(string)
Returns the length of the string, excluding the null terminator.
strrev(string)
Reverses all characters except the null terminator in the string.
strdup(string)
Holds a duplicate of the string pointed to by string.
isalnum(int ch)
Returns a non-zero value if its argument is either a letter of the alphabet or a digit.
isalpha(int ch)
Returns a non-zero value if ch is a letter of the alphabet. Otherwise, zero is returned.
isdigit(int ch)
Returns non-zero if ch is a digit from 0-9. Otherwise, zero is returned.
islower(int ch)
Returns non-zero if ch is a lowercase letter (a-z). Otherwise, zero is returned.
ispunct(int ch)
Returns a non-zero value if ch is a punctuation character excluding the space. Otherwise, zero is returned.
isspace(int ch)
Returns non-zero if ch is one of the following: a space, tab, carriage return. 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.
fmod()
Returns the remainder of x/y.
pow()
Returns base raised to the exp power(base, exp).
pow10()
Returns 10 raised to the power of n.
sqrt()
Returns the square root of num.
Pointer
A variable that stores 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.
Single Linked List
A linked list where navigation is forward only.
Doubly Linked List
A linked list where forward and backward navigation is possible.
Circular Linked List
A linked list where the last element is linked to the first element.
Self Referential Structures
Structures that have one or more pointers which point to the same type of structure as their member.
Structure
A collection of related heterogenous fields, grouped together to form a single unit.
Referencing Structure Elements
Accessing or changing the values inside a structure.
Array of Structures
Storing information about multiple entities (e.g., students) using a structure for each entity and organizing them into an array.
Structures Within a Structure
Placing a structure within another structure, creating a hierarchical data organization.
Passing a Structure to a Function
Passing a copy of the entire structure to a function, ensuring the original structure remains unchanged.
Pointers to Structures
Allowing manipulation of the memory address of a structure, enabling indirect access to its members.
Linked List of Structures
Storing a list of data using structures and pointers, offering dynamic size and flexible structure.
HEAD Node
The first node in a linked list, essential for accessing the rest of the list.
MIDDLE Node(s)
Nodes between the head and last nodes in a linked list, each containing a pointer to the next node.
LAST Node
The final node in a linked list, with its next pointer set to NULL.
File Handling
Storing data or information in a file with the help of a program.
Stream
A connection between your program and a file or device, enabling easy reading or writing of data.
Text Mode
A file processing mode where the value written to the file is the actual sequence of characters.
Binary Mode
A file processing mode where the value written to the file is converted into a sequence of bytes.
Text Files
Text files that contain data in the form of characters, each line ending with a newline character (
).
Binary Files
Files containing data in binary form (0's and 1's), created and read only from within a program.
File Pointer
A reference to a specific location within an opened file, used for file operations like read, write, and close.
fopen()
Opens an existing file or creates a new file.
fprintf()
Writes data into an existing file.
fscanf()
Reads data from a file.
fputc()
Writes a character into a file.
fgetc()
Reads a character from a file.
fclose()
Closes a file.