Arts Homework Help | Arts Assignment Help - Answers
Recently Asked Arts Assignment Help, Questions and Answers
I have 4 unit tests to complete which relate back to music (aserve2.0), here is the first one let me know if it is do able for you:
In last weeks practical we learnt how to create arrays of a fixed length. This week we will learn to use an array whose length can grow and shrink dynamically at run time. We will learn:
- How to create a vector
- How to read and write data into a vector
The std::arry type allow us to create any number of variables of the same type in a single statement. For example, an array of integer variables for our 10 note numbers can be created by the following declaration:
std::array<int, 10> notes;
We can then put numbers in this sequence like so.
notes = 60; notes = 62; ...
However, once we reach:
notes = 78; //end of array notes = 80; //Error cannot do this
We cannot therefore store more than 10 values in this array without creating a larger array. There are many times where we cannot determine how many ...