1/133
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
scanf()
A function in C that is used to read formatted input from the console.
Structs
A data structure in C that allows the grouping of related data items under one name.
UNIX Commands
Basic commands used in the UNIX operating system for performing various tasks.
Pass-by-Pointer
A method of passing arguments to a function in C by passing the memory address of the variable.
C
A programming language used for system programming and general-purpose programming.
C++
A programming language that is an extension of C and supports object-oriented programming.
include statement
A statement in C/C++ that includes a library or header file in the program.
int
A data type in C/C++ that represents integers.
using namespace std
A statement that allows the use of names from the std namespace without having to specify the namespace each time.
Declaring variables and arrays
The process of defining variables and arrays in a program, specifying their data types and names.
int main()
The main function in a C++ program, which serves as the entry point for the program's execution.
char initials[]
An array declaration that defines a character array named "initials".
printf()
A function in C that is used to print formatted output to the console.
%d
A format specifier in printf() that is used to print a signed decimal integer.
%f
A format specifier in printf() that is used to print a floating-point value.
\n
The newline character, which is used to start a new line in the output.
%d
A format specifier in scanf() that is used to read a signed decimal integer.
%f
A format specifier in scanf() that is used to read a floating-point value.
Data members
Variables inside the curly braces of a struct that are included in each instance of the struct.
Typedef
A keyword in C used to create a synonym for a type, making the code more readable.
Dot notation
A way to access data members of a struct using the dot operator.
Bracket notation
A way to access elements in a struct array using square brackets.
Vertex
A point in a rectangle that represents one of its corners.
Compilation
The process of translating source code into machine code.
IDE
Integrated Development Environment, a software application that provides comprehensive facilities for software development.
Terminal
A command-line interface where users can interact with the operating system by typing commands.
UNIX
A powerful operating system that is the foundation for many other systems, including MacOS.1. cat
cd
Change directories
cp
Copy the contents of file into file2
history
List history of all commands issued at system prompt
Is
List the files and subdirectories in a directory
Is-F
List the difference between files and directories--directories have a slash (/)
Is-|
List files with status/detail information
Is -It
List file information in long format, sorted by time with newest files or newly changed files appearing first
Is-a
List all the files in a directory including dot files
rm
Remove or delete files
mkdir
Make a directory
rmdir
Remove directory
mv
Move file to file 2
pwd
Print the pathname of the current directory
Pointers
stores the memory address location to where value is stored, not the actual value
Declaration
type* ptrName e.g:int* minInd char* aLetter double* minVal bool* isGood
Referencing
prepend the reference operator, ‘&’, to any variable to get its memory address
Dereferencing
prepend the dereference operator, ‘*’, to any pointer to get the values stored at the memory address pointed to
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
Functions
a block of code that performs a specific task and can be called multiple times
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.
Ampersand (&)
The symbol used in C to pass a parameter by reference.
Asterisk (*)
The symbol used in C to catch and use a parameter passed by reference.
Arrays
Blocks of memory in C that store multiple elements of the same data type.
Compilation error
An error that occurs during the compilation of a program.
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.
Basic UNIX commands
Fundamental commands used in the UNIX operating system.
UNIX Environments & IDEs
The environments and integrated development environments (IDEs) used for programming in UNIX.
ls
A command used to list files and directories in UNIX.
ls -l
A command used to list files and directories in long format in UNIX.
mkdir
A command used to create a new directory in UNIX.
cp
A command used to copy files and directories in UNIX.
terminal
The command-line interface in the Mac operating system.
Run button
A button in an IDE that is used to execute or run a program.
Command-Line Arguments
Arguments passed to a program when it is run from the command line.
ARGument Count
An integer that indicates how many arguments were entered on the command line when a program was started.
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.
Execution of the program
The process of running a program.
%p
The format specifier used to print a pointer in C.
constant reference to the first element
The name of an array acts as a constant reference to its first element.
The size of an integer in memory, typically 4 bytes.
int box
Compilation error
An error that occurs during the compilation process, indicating that the code cannot be translated into machine code.
Run-time error
An error that occurs during program execution, indicating an unexpected behavior or violation of program logic.
Global variables
Variables that are declared outside of any function and can be accessed by any part of the program.
Stack
A region of memory used to keep track of function calls, including return values, parameters, and local variables.
Memory Model
The way variables and other data are stored in different parts of memory during program execution.
Heap
A portion of memory used for dynamic memory allocation, where memory can be explicitly allocated and deallocated.
Compilation
The process of translating source code into machine code.
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.
calloc
A function in C used for contiguous allocation of multiple blocks, all initialized to 0, on the heap.
Heap
The area of memory used for dynamic memory allocation.
Pointer
A variable that stores the memory address of another variable.
Arrow (->)
A syntax used to access the data members of a struct through a pointer.
printf
A function in C used for formatted output.
deference
The process of accessing the value stored at a memory address pointed to by a pointer.
realloc()
A function that allows for growing an array without using the realloc() function.
valgrind
A debugging tool used to detect memory leaks and errors in C programs.
gdb
A debugging tool used for analyzing and debugging C programs.
Dynamically Allocated Memory
Memory allocated during program execution using functions like malloc().
Memory Leaks
A type of programming error where allocated memory is not properly deallocated, leading to memory waste.
gcc
The GNU Compiler Collection, a compiler for programming languages like C and C++.
-g flag
A flag used with gcc to enable debugging information in the compiled program.
-o flag
A flag used with gcc to specify the name of the executable file.
./a.out
The default name of the executable file generated by gcc.
HEAP SUMMARY
A summary of memory usage and allocation in a program.
LEAK SUMMARY
A summary of memory leaks in a program.
--leak-check=full
A flag used with valgrind to provide detailed information about leaked memory.
In use at exit
The amount of memory still being used when the program stops.
Definitely lost
Memory that has been allocated but not properly deallocated.
Possibly lost
Memory that may have been lost or leaked.
Rerun with --leak-check=full
A command to rerun valgrind with full leak-checking enabled.
Byte
A unit of digital information storage.
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.
--leak-check=full
A command-line option for valgrind that enables full memory leak checking.