Exam1Prep

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

1/133

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

134 Terms

1
New cards

scanf()

A function in C that is used to read formatted input from the console.

2
New cards

Structs

A data structure in C that allows the grouping of related data items under one name.

3
New cards

UNIX Commands

Basic commands used in the UNIX operating system for performing various tasks.

4
New cards

Pass-by-Pointer

A method of passing arguments to a function in C by passing the memory address of the variable.

5
New cards

C

A programming language used for system programming and general-purpose programming.

6
New cards

C++

A programming language that is an extension of C and supports object-oriented programming.

7
New cards

include statement

A statement in C/C++ that includes a library or header file in the program.

8
New cards

int

A data type in C/C++ that represents integers.

9
New cards

using namespace std

A statement that allows the use of names from the std namespace without having to specify the namespace each time.

10
New cards

Declaring variables and arrays

The process of defining variables and arrays in a program, specifying their data types and names.

11
New cards

int main()

The main function in a C++ program, which serves as the entry point for the program's execution.

12
New cards

char initials[]

An array declaration that defines a character array named "initials".

13
New cards

printf()

A function in C that is used to print formatted output to the console.

14
New cards

%d

A format specifier in printf() that is used to print a signed decimal integer.

15
New cards

%f

A format specifier in printf() that is used to print a floating-point value.

16
New cards

\n

The newline character, which is used to start a new line in the output.

17
New cards

%d

A format specifier in scanf() that is used to read a signed decimal integer.

18
New cards

%f

A format specifier in scanf() that is used to read a floating-point value.

19
New cards

Data members

Variables inside the curly braces of a struct that are included in each instance of the struct.

20
New cards

Typedef

A keyword in C used to create a synonym for a type, making the code more readable.

21
New cards

Dot notation

A way to access data members of a struct using the dot operator.

22
New cards

Bracket notation

A way to access elements in a struct array using square brackets.

23
New cards

Vertex

A point in a rectangle that represents one of its corners.

24
New cards

Compilation

The process of translating source code into machine code.

25
New cards

IDE

Integrated Development Environment, a software application that provides comprehensive facilities for software development.

26
New cards

Terminal

A command-line interface where users can interact with the operating system by typing commands.

27
New cards

UNIX

A powerful operating system that is the foundation for many other systems, including MacOS.1. cat :Print contents of file in the command window

28
New cards

cd

Change directories

29
New cards

cp

Copy the contents of file into file2

30
New cards

history

List history of all commands issued at system prompt

31
New cards

Is

List the files and subdirectories in a directory

32
New cards

Is-F

List the difference between files and directories--directories have a slash (/)

33
New cards

Is-|

List files with status/detail information

34
New cards

Is -It

List file information in long format, sorted by time with newest files or newly changed files appearing first

35
New cards

Is-a

List all the files in a directory including dot files

36
New cards

rm

Remove or delete files

37
New cards

mkdir

Make a directory

38
New cards

rmdir

Remove directory

39
New cards

mv

Move file to file 2

40
New cards

pwd

Print the pathname of the current directory

41
New cards

Pointers

stores the memory address location to where value is stored, not the actual value

42
New cards

Declaration

type* ptrName e.g:int* minInd char* aLetter double* minVal bool* isGood

43
New cards

Referencing

prepend the reference operator, ‘&’, to any variable to get its memory address

44
New cards

Dereferencing

prepend the dereference operator, ‘*’, to any pointer to get the values stored at the memory address pointed to

45
New cards

Pass-by-Reference

a method of passing arguments to a function where the memory address of the argument is passed instead of the actual value

46
New cards

Functions

a block of code that performs a specific task and can be called multiple times

47
New cards

local variable

a variable that is declared and used within a specific function or block of code1. Pass-by-Reference:A method of passing parameters to a function in C where the changed value of the parameter is returned to the calling code.

48
New cards

Ampersand (&)

The symbol used in C to pass a parameter by reference.

49
New cards

Asterisk (*)

The symbol used in C to catch and use a parameter passed by reference.

50
New cards

Arrays

Blocks of memory in C that store multiple elements of the same data type.

51
New cards

Compilation error

An error that occurs during the compilation of a program.

52
New cards

Compiles ok, but run-time error crashes program

A situation where a program compiles without errors but encounters an error during runtime, causing the program to crash.

53
New cards

Basic UNIX commands

Fundamental commands used in the UNIX operating system.

54
New cards

UNIX Environments & IDEs

The environments and integrated development environments (IDEs) used for programming in UNIX.

55
New cards

ls

A command used to list files and directories in UNIX.

56
New cards

ls -l

A command used to list files and directories in long format in UNIX.

57
New cards

mkdir

A command used to create a new directory in UNIX.

58
New cards

cp

A command used to copy files and directories in UNIX.

59
New cards

terminal

The command-line interface in the Mac operating system.

60
New cards

Run button

A button in an IDE that is used to execute or run a program.

61
New cards

Command-Line Arguments

Arguments passed to a program when it is run from the command line.

62
New cards

ARGument Count

An integer that indicates how many arguments were entered on the command line when a program was started.

63
New cards

ARGument Vector

An array of pointers to arrays of characters that contains all the characters entered on the command line when a program was started.

64
New cards

Execution of the program

The process of running a program.

65
New cards

%p

The format specifier used to print a pointer in C.

66
New cards

constant reference to the first element

The name of an array acts as a constant reference to its first element.

67
New cards

The size of an integer in memory, typically 4 bytes.

int box

68
New cards

Compilation error

An error that occurs during the compilation process, indicating that the code cannot be translated into machine code.

69
New cards

Run-time error

An error that occurs during program execution, indicating an unexpected behavior or violation of program logic.

70
New cards

Global variables

Variables that are declared outside of any function and can be accessed by any part of the program.

71
New cards

Stack

A region of memory used to keep track of function calls, including return values, parameters, and local variables.

72
New cards

Memory Model

The way variables and other data are stored in different parts of memory during program execution.

73
New cards

Heap

A portion of memory used for dynamic memory allocation, where memory can be explicitly allocated and deallocated.

74
New cards

Compilation

The process of translating source code into machine code.

75
New cards

Execution

The process of running a program and executing its instructions.1. Dynamic Memory Allocation:The process of allocating and managing memory dynamically during program execution.

76
New cards

calloc

A function in C used for contiguous allocation of multiple blocks, all initialized to 0, on the heap.

77
New cards

Heap

The area of memory used for dynamic memory allocation.

78
New cards

Pointer

A variable that stores the memory address of another variable.

79
New cards

Arrow (->)

A syntax used to access the data members of a struct through a pointer.

80
New cards

printf

A function in C used for formatted output.

81
New cards

deference

The process of accessing the value stored at a memory address pointed to by a pointer.

82
New cards

realloc()

A function that allows for growing an array without using the realloc() function.

83
New cards

valgrind

A debugging tool used to detect memory leaks and errors in C programs.

84
New cards

gdb

A debugging tool used for analyzing and debugging C programs.

85
New cards

Dynamically Allocated Memory

Memory allocated during program execution using functions like malloc().

86
New cards

Memory Leaks

A type of programming error where allocated memory is not properly deallocated, leading to memory waste.

87
New cards

gcc

The GNU Compiler Collection, a compiler for programming languages like C and C++.

88
New cards

-g flag

A flag used with gcc to enable debugging information in the compiled program.

89
New cards

-o flag

A flag used with gcc to specify the name of the executable file.

90
New cards

./a.out

The default name of the executable file generated by gcc.

91
New cards

HEAP SUMMARY

A summary of memory usage and allocation in a program.

92
New cards

LEAK SUMMARY

A summary of memory leaks in a program.

93
New cards

--leak-check=full

A flag used with valgrind to provide detailed information about leaked memory.

94
New cards

In use at exit

The amount of memory still being used when the program stops.

95
New cards

Definitely lost

Memory that has been allocated but not properly deallocated.

96
New cards

Possibly lost

Memory that may have been lost or leaked.

97
New cards

Rerun with --leak-check=full

A command to rerun valgrind with full leak-checking enabled.

98
New cards

Byte

A unit of digital information storage.

99
New cards

Block

A contiguous set of bytes in memory.1. valgrind:A memory error detector tool used to detect memory leaks and other memory-related errors in programs.

100
New cards

--leak-check=full

A command-line option for valgrind that enables full memory leak checking.