Lecture 6 - Pointers and Functions Flashcards
data type that “points” to another value stored in memory
Pointers
marks the variable as a pointer
Asterisk
returns the variable’s address
Reference Pointer (&)
returns the value stored in a memory address
Dereference Pointer (*)
a set of statements that take inputs, does a specific task or computation to produce a certain output.
Functions
Built-in programs already available in C++, its functions are already available for use and will no longer require additional modification or programming.
Pre-Defined / Built-in
Created and modified by the user or programmer. Functions defined by programmers to suit the specifications set.
User-Defined
A built-in function in C++ by using header files or libraries where modification is not allowed
Pre-defined
A variable declared within a block and not accessible outside of that block.
Local Variable
How to declare functions?
dataType function_name (parameter list)
the variables or inputs of a function
parameter list
A variable declared outside of all the functions in a program and is accessible throughout the program.
Global Variable
it creates the function and is divided into two sections
Function Definition
defines the name of the function, the type of data to be returned, and the parameter list
Function Header
Parts of a Function Definition
Function Header & Function Body