1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Julli [10]
3 years ago
6

Overview: In this problem, you will emulate the push_back function of the C vector class. We will call this function append . Th

is function will insert an element to an array at the smallest vacant index. In case the array is full, the function should perform array doubling and then insert the element to the new array.
Unlike the resize function (Recitation 3 exercise), here you will not be returning a pointer after doubling the array. Instead, a reference-to-array pointer will be passed to your function append , so that you can modify the pointer to the array itself. The function should return true if array doubling was performed, otherwise return false.
Use the function prototype provided below:
bool append(string* &str_arr, string s, int &numEntries, int &arraySize);
INPUT PARAMETERS:
→ str_arr is an array of type string in which you insert elements. A reference to this array pointer is passed to your function.
→s is a new string that you want to insert in your string array
→ numEntries keeps track of the number of elements that have been inserted in your array so far
→ array Size variable stores the current size of your array
OUTPUT PARAMETERS:
→ doubled is just a boolean value true or false
You return true if array has been doubled else return false
You are also required to update the variable numEntries and array Size within the function:
→ Update numEntries when you add a new element to the array.
→ Update array Size whenever you perform array doubling.
Computers and Technology
1 answer:
lbvjy [14]3 years ago
6 0

Answer:

idontttttttttttttttttt now please help me

You might be interested in
Electronic cover letters are longer than traditional paper cover letters.
8090 [49]

Answer: F

Explanation:

3 0
3 years ago
Read 2 more answers
What is the primary responsibility of the physical layer in data communication?
melamori03 [73]
 It is responsible for transmitting these bits as signals over a wire, optical fiber, wireless, or other <span>medium.</span>
3 0
3 years ago
What is meant ny backing up files through cloud computing
vitfil [10]

The cloud is a network of computer linked by the internet to store information. Backing up file using cloud computing means that your files will be put on the cloud as an extra copy in case you lose them or such. The cloud will still have a copy to use.

6 0
3 years ago
Read 2 more answers
Why was Unicode invented?
BabaBlast [244]
To short letters to send worldwide.
6 0
4 years ago
What is the numeric range of a 16-bit unsigned binary value?
seraphim [82]
<span>A 16-bit integer can store 216 (or 65,536) distinct values. In an unsigned representation, these values are the integers between 0 and 65,535; using two's complement, possible values range from −32,768 to 32,767. Hence, a processor with 16-bit memory addresses can directly access 64 KB of byte-addressable memory.</span>
5 0
3 years ago
Other questions:
  • What is scientific and​
    13·2 answers
  • Word, by default, places a tab stop at every ____ mark on the ruler.
    6·1 answer
  • Mia uses the formula pi times r to the power of 2 to find the area of a circle. What is pi times r to the power of 2 an example
    9·2 answers
  • The IT Department already has been testing Windows Server 2012 R2, and some time ago purchased licenses to convert all of its Wi
    14·1 answer
  • Select the correct answer.
    5·1 answer
  • In a singing competition, there are 34 more men than women
    5·2 answers
  • The Publisher-Subscriber design pattern is used to create __________________ communication between software objects and is used
    13·1 answer
  • Computers were originally invented to
    12·2 answers
  • Can you withdraw from courses in top hat?
    14·1 answer
  • Imagine that you need to prepare for three end-of-term tests. What steps will you take to make sure your study time is well spen
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!