Qingquan Li

Results 164 issues of Qingquan Li

> Concept: Functions can return pointers, but you must be sure the item the pointer references still exists. ### Example: ```c++ #include using namespace std; int* creat_an_array(int); int main() {...

C++

> Concept: A pointer can be used as a function parameter. It gives the function access to the original argument, much like a reference parameter does. ```c++ // This program...

C++

- `i++` will increment the value of `i`, but return the original value that `i` held before being incremented. - `++i` will increment the value of `i`, and then return...

C++

Reference: Book: *Starting Out with C++ from Control Structures to Objects, byTony Gaddis, ninth edition* Running on [pythontutor.com](https://pythontutor.com/) and visualizing code. **Contents:** 1. Introduction to Recursion 2. Using Recursion to...

C++

> Concept: Two or more functions may have the **same name**, as long as their **parameter** lists are different. Recall that a class can have more than one **constructor**, but...

C++

> Concept: The range-based for loop is a loop that iterates once for each element in an array. Each time the loop iterates, it copies an element from the array...

C++

> Concept: A two-dimensional array is like several identical arrays put together. It is useful for storing multiple sets of data. ```c++ double array[Rows][Columns]; ``` ```c++ // Assigns the value...

C++

> Concept: To pass an array as an argument to a function, pass the name of the array. ```c++ // Function prototype: return_type function_name(data_type[], int); ... // Call the function:...

C++

Reference: Book: *Starting Out with C++ from Control Structures to Objects, byTony Gaddis, ninth edition* **Contents:** 1. Arrays hold multiple values 1.1 Memory Requirements of Arrays 2. Accessing Array Elements...

C++

Reference: Book: *Starting Out with C++ from Control Structures to Objects, by Tony Gaddis, ninth edition* > Concept: When a program needs to save data for later use, it writes...

C++