COMPROG - Arrays to File Handling

0.0(0)
studied byStudied by 2 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/71

flashcard set

Earn XP

Description and Tags

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.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

72 Terms

1
New cards

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.

2
New cards

Two-Dimensional Array

An array that is like a table of elements, represented as [array size] [array size];

3
New cards

Three-Dimensional Array

An array that is like a table within a table, represented as [array size][array size][array size];

4
New cards

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.

5
New cards

Shell Sort

A sorting algorithm that sorts elements by comparing elements far apart and gradually reducing the gap between them.

6
New cards

Balloon Sort

A sorting method where elements move toward their correct position faster than Bubble Sort.

7
New cards

Linear Search

A sequential searching algorithm that checks every element of the list until the desired element is found.

8
New cards

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.

9
New cards

Function

A program that returns a value unless declared as void; the main() function is the entry point.

10
New cards

Pre-defined functions

Programs embedded in the C Programming Language that are ready to use.

11
New cards

User-defined functions

Programs created by the programmer for a special purpose.

12
New cards

Function Prototyping

Declaring a function before it is used, specifying the number and type of arguments and the return type.

13
New cards

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.

14
New cards

Call by Reference

A function call where addresses of actual parameters are passed, allowing changes in the called function to affect the original values.

15
New cards

strcpy(string1, string2)

Copies the content of string2 to string1.

16
New cards

strncpy(target, source, count)

Copies count characters from string source into string target.

17
New cards

strcat(string 1, string2)

Concatenates the content of string1 and string2; assigns the concatenated string to string1 and leaves string2 untouched.

18
New cards

strncat(string1, string2, count)

Concatenates no more than count characters of string2 to string1 and assigns the concatenated string to string1.

19
New cards

strcmp(string1, string2)

Compares string1 and string2 and returns an integer based on whether string1 is less than, equal to, or greater than string2.

20
New cards

stricmp(string1, string2)

Compares two strings while ignoring cases.

21
New cards

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().

22
New cards

strlwr(string)

Converts the string to lowercase.

23
New cards

strupr(string)

Converts the string to uppercase.

24
New cards

strnset(string,c,count)

Sets the first count character of the string to the value of c.

25
New cards

strset(string,ch)

Sets all characters in the string to the value of ch.

26
New cards

strchr(string,c)

Returns a substring of string beginning at the first occurrence of character c up to the end of the string.

27
New cards

strlen(string)

Returns the length of the string, excluding the null terminator.

28
New cards

strrev(string)

Reverses all characters except the null terminator in the string.

29
New cards

strdup(string)

Holds a duplicate of the string pointed to by string.

30
New cards

isalnum(int ch)

Returns a non-zero value if its argument is either a letter of the alphabet or a digit.

31
New cards

isalpha(int ch)

Returns a non-zero value if ch is a letter of the alphabet. Otherwise, zero is returned.

32
New cards

isdigit(int ch)

Returns non-zero if ch is a digit from 0-9. Otherwise, zero is returned.

33
New cards

islower(int ch)

Returns non-zero if ch is a lowercase letter (a-z). Otherwise, zero is returned.

34
New cards

ispunct(int ch)

Returns a non-zero value if ch is a punctuation character excluding the space. Otherwise, zero is returned.

35
New cards

isspace(int ch)

Returns non-zero if ch is one of the following: a space, tab, carriage return. Otherwise, zero is returned.

36
New cards

abs()

Returns the absolute value of the integer number.

37
New cards

ceil()

Returns the smallest integer represented as double not less than num.

38
New cards

fabs()

Returns the float absolute value of num.

39
New cards

floor()

Returns the largest integer represented as double not greater than num.

40
New cards

fmod()

Returns the remainder of x/y.

41
New cards

pow()

Returns base raised to the exp power(base, exp).

42
New cards

pow10()

Returns 10 raised to the power of n.

43
New cards

sqrt()

Returns the square root of num.

44
New cards

Pointer

A variable that stores the memory address of another variable.

45
New cards

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.

46
New cards

Single Linked List

A linked list where navigation is forward only.

47
New cards

Doubly Linked List

A linked list where forward and backward navigation is possible.

48
New cards

Circular Linked List

A linked list where the last element is linked to the first element.

49
New cards

Self Referential Structures

Structures that have one or more pointers which point to the same type of structure as their member.

50
New cards

Structure

A collection of related heterogenous fields, grouped together to form a single unit.

51
New cards

Referencing Structure Elements

Accessing or changing the values inside a structure.

52
New cards

Array of Structures

Storing information about multiple entities (e.g., students) using a structure for each entity and organizing them into an array.

53
New cards

Structures Within a Structure

Placing a structure within another structure, creating a hierarchical data organization.

54
New cards

Passing a Structure to a Function

Passing a copy of the entire structure to a function, ensuring the original structure remains unchanged.

55
New cards

Pointers to Structures

Allowing manipulation of the memory address of a structure, enabling indirect access to its members.

56
New cards

Linked List of Structures

Storing a list of data using structures and pointers, offering dynamic size and flexible structure.

57
New cards

HEAD Node

The first node in a linked list, essential for accessing the rest of the list.

58
New cards

MIDDLE Node(s)

Nodes between the head and last nodes in a linked list, each containing a pointer to the next node.

59
New cards

LAST Node

The final node in a linked list, with its next pointer set to NULL.

60
New cards

File Handling

Storing data or information in a file with the help of a program.

61
New cards

Stream

A connection between your program and a file or device, enabling easy reading or writing of data.

62
New cards

Text Mode

A file processing mode where the value written to the file is the actual sequence of characters.

63
New cards

Binary Mode

A file processing mode where the value written to the file is converted into a sequence of bytes.

64
New cards

Text Files

Text files that contain data in the form of characters, each line ending with a newline character (
).

65
New cards

Binary Files

Files containing data in binary form (0's and 1's), created and read only from within a program.

66
New cards

File Pointer

A reference to a specific location within an opened file, used for file operations like read, write, and close.

67
New cards

fopen()

Opens an existing file or creates a new file.

68
New cards

fprintf()

Writes data into an existing file.

69
New cards

fscanf()

Reads data from a file.

70
New cards

fputc()

Writes a character into a file.

71
New cards

fgetc()

Reads a character from a file.

72
New cards

fclose()

Closes a file.