// archives

std::

This tag is associated with 2 posts

The Implications of Using Arrays as Arguments

Let’s look at the implications of (A-1)

The function call sum_arr(cookies, ArSize)

Passes the address of the first element of the cookies array and the number of elements of the array to the sum_arr() function

The sum_arr() function

Assigns the cookies address to the pointer variable arr and assigns ArSize to the int variable n

This means (A-1) doesn’t really [...]

Writing to a Text File

For file output, C++ uses analogs to cout

So, to prepare for file output, let’s review some basic facts about using cout for console output
(B-1):  

You must include the iostream header file.
The iostream header file defines an ostream class for handling output.
The iostream header file declares an ostream variable, or object, called cout.
You must account [...]