1/47
Flashcards for reviewing C programming concepts, including 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.
Two-Dimensional Array
A data structure that stores elements in a table format.
Three-Dimensional Array
A data structure that can be visualized as a table within a table.
Bubble Sort
A sorting algorithm that compares adjacent elements and swaps them if they are in the wrong order, effectively 'bubbling' the largest elements to the top.
Shell Sort
A sorting algorithm that compares elements that are far apart and then gradually reduces the gap between them.
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).
Pre-defined functions
Functions that are imbedded in the C Programming Language and are ready to use.
User-defined functions
Functions created by the programmer for a special purpose.
Function Prototyping
Declaring the function to the program, including the number and type of arguments and the return type.
Call by Value
Passing the actual value/s (argument/s) to the called function.
Call by Reference
Passing the address/es of the actual parameter/s to the called function.
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 occurrence of character c up to the end of the string.
strlen(string)
Returns the length of the string.
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 a non-zero if ch is a letter of the alphabet.
isdigit(int ch)
Returns non-zero if ch is a digit from 0-9.
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.
Pointer
Declared by specifying its name and type, with an asterisk (*) symbol added before the pointer’s name.
Linked List
A dynamic data structure used to store a sequence of elements, where each element (node) contains the data and a pointer to the next node.
Single Linked List
Navigation is Forward Only.
Doubly Linked List
Forward and Backward Navigation is Possible.
Circular Linked List
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 heterogeneous fields (fields with different data types grouped together).
Passing Structures to Functions
Sending all necessary data together in one package to a function.
Pointers
Allow you to work with the memory address of a structure.
Linked List of Structures
A way of storing a list of data using structures and pointers, where nodes can be anywhere in memory and each node points to the next one.
File Handling
How we store the available data or info in a file with the help of a program.
Text Mode
Value written to the file is the actual sequence of characters.
Binary Mode
Value written to the file is converted into a sequence of bytes.
Text Files
Contains data in the form of characters and each line ends with a new line character ('\n').
Binary Files
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 all file operations.
fopen()
Opens a file and associate a stream with it.
File opening modes
Specifies the allowed operations on the file to be opened.
rename(old filename, new filename)
Renames a file.
remove(filename)
Deletes a file.