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
Alborosie
3 years ago
8

Write a function that dynamically allocates an array of integers. The function should accept an integer argument indicating the

number of elements to allocate. The function should return a pointer to the array. Call the function in a complete program.
Computers and Technology
1 answer:
viktelen [127]3 years ago
5 0

Answer:

#include <iostream>

#include <cstdlib>

using namespace std;

int* integerArr( int number);

int main(){

   int* address;

   address = integerArr(5);

   for ( int i = 0; i < 10; i++ ) {

     cout << "Address of the integer array:  ";

     cout << *(address + i) << endl;

   }

   return 0;

}

int* integerArr( int number){

   int myArr[number];

   for (int i = 0; i < number; ++i) {

     myArr[i] = rand();

   }

   int* ptr= myArr;

   return ptr;

}

Explanation:

The C++ source calls the defined pointer function "integerArr" with an integer argument to declare arrays of dynamic length, in the main function of the program and the items of the array are printed on the screen.

You might be interested in
You have one ip address provided from your isp with a /30 mask. However, you have 300 users that need to access the internet. Wh
creativ13 [48]

Answer:

a. PAT

Explanation:

20.You have one IP address provided from your ISP with a /30 mask. However, you have 300 users that need toaccess the Internet. What technology will you use to implement a solution?a.PATb.VPNc.DNSd.VLANs

4 0
2 years ago
Consider the following relations:
ArbitrLikvidat [17]

Answer:

Check the explanation

Explanation:

--Query 1)

SELECT ename, sal, age

FROM Emp;

--Query 2)

SELECT did

FROM Dept

WHERE floot = 10 AND budget<15000;

4 0
3 years ago
Which of the following sentences use the subjunctive mood correctly?Check all that apply. a. Dr. Franklin wishes he were the one
vredina [299]

Answer:

a. Dr. Franklin wishes he were the one who had invented the new web application.

b. If he were willing to submit the proposal, we might win the bid.

Explanation:

The subjunctive mood is when we're talking about wishes, doubts, and possibilities, in this case, we have two examples, where Dr. Franklin wishes to invent the new web application, and the other sentence is a possibility because he believes that they can win the bid. The last example is an affirmation.

4 0
3 years ago
Write an If...Then statement that assigns 0 to intX when intY is equal to 20
BigorU [14]

Answer:

wh,,what?

Explanation:

3 0
3 years ago
Read 2 more answers
What is a router?
uranmaximum [27]

Answer:

A router receives and sends data on computer networks. Routers are sometimes confused with network hubs, modems, or network switches. However, routers can combine the functions of these components, and connect with these devices, to improve Internet access or help create business networks.

I believe the answer would be B). A device that sends data to the receiving device

Explanation:

3 0
3 years ago
Other questions:
  • What is the abbreviation used for educational sites/?
    8·1 answer
  • Which of the following is not an operating system
    11·2 answers
  • What is a googleplex?
    7·1 answer
  • Which function would you use to make sure all names are prepared for a mailing label?
    10·2 answers
  • How network diagram help in scheduling a project? Draw activity network diagram as per given
    7·1 answer
  • WHO LOVES THE KREW LOOK IT UP ON YOU_TUBE IF UR NOT SURE BUT PLZ SUBSCRIBE TO HER SHE DA BEST "YOOT" the one with pink and golde
    13·3 answers
  • Temperature converter. This program should prompt the user for two arguments, first a decimal number and second, a single letter
    10·1 answer
  • You are setting up a home network for your friend. She has students visiting her home regularly for lessons and wants to provide
    14·1 answer
  • How are computers classified into different types? Explain ​
    6·1 answer
  • A diagram of a ten-node network that uses ten routers
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!