3-Refresher - / Crash course #include <iostream> /...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
// Crash course #include <iostream> // function prototype void caller(); int main (void) { // Variables // A named location in memory that represents data // data ranges from boolean values, integers, floating point // numbers, to complex types defined by structs. // some value type variables: bool checked = false; int integer = 5; double data = 112.45; // Arrays // A collection of variables of the same type. // Supports random access through the index // Accessing an array element is just a calculation of // the memory address + index offset * variable size // arrays are reference types int array1[] = { 1, 3, 7, 5, 19 }; // Pointers // A variable that contains a memory address that references // or points to a variable of the pointer type int x = 12; // normal variable int *ptr; // pointer variable of integer type (can point to an int) ptr = &x; // set the pointer to the address of x // Iteration for (int i = 0; i < 10; i++) std::cout << "Hello\n"; int value = 0; do { std::cout << "Give me a number: ";
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

3-Refresher - / Crash course #include &lt;iostream&gt; /...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online