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
Suppose barriers to entry exist in the telecommunications industry. This best describes a _____ market.
melamori03 [73]
The correct answer for the question that is being presented above is this one: "monopolistic." Suppose barriers to entry exist in the telecommunications industry. This best describes a monopolistic market. In a <span>monopolistic market, that specific source of service or good, is being handled by a single company.</span>

4 0
3 years ago
Whose job is it to ensure that a group stays focused and on schedule?
topjm [15]

\text{Hello There!}

\text{The job of the facilitator is often to organize group activities.}

\bold{Therefore,\;your \;answer \;is\;going\;to\;be\;A, the\;facilitator.}

\huge\text{I hope this helped! :)}

\rule{250}{1.5}

5 0
3 years ago
15
iVinArrow [24]

I believe that the answer is A: Extension but I am not 100% sure, hope this helps.

7 0
3 years ago
Read 2 more answers
Which of the following is true about images that are arranged in a collumn
makvit [3.9K]
Figure 1: An image — an array or a matrix of pixels arranged in columns and rows. In a (8-bit) greyscale image each picture element has an assigned intensity that ranges from 0 to 255. A grey scale image is what people normally call a black and white image, but the name emphasizes that such an image will also include many shades of grey. Figure 2: Each pixel has a value from 0 (black) to 255 (white). The possible range of the pixel values depend on the colour depth of the image, here 8 bit = 256 tones or greyscales. A normal greyscale image has 8 bit colour depth = 256 greyscales. A “true colour” image has 24 bit colour depth = 8 x 8 x 8 bits = 256 x 256 x 256 colours = ~16 million colours.
7 0
4 years ago
Use the function varimp() on the output of train() and save it to an object called imp:_____.
Orlov [11]

Use the function varimp() on the output of train() and save it to an object called imp object.

<h3>What is the classification that has More than Two Classes and the Caret Package</h3>

In the Classification that has More than Two Classes and the Caret Package section, one need to use the methods that can be able to adapt to higher  forms or dimensions and through a lot of different machine learning algorithms.

Note that varImp is seen as a generic method for calculating variable .

Hence, Use the function varimp() on the output of train() and save it to an object called imp object.

Learn more about Computer function from

brainly.com/question/17048576

#SPJ1

5 0
2 years ago
Other questions:
  • Complete the paragraph to explain how Angelina can notify readers that her report is just a draft. Angelina has decided to add t
    12·2 answers
  • Erick, who is taking an online course, sent an e-mail to his
    14·2 answers
  • Which method deletes a footer from a document?
    13·2 answers
  • How can you autohide the taskbar in Windows 10?
    8·2 answers
  • Your ___ can provide hardware firewall protection for your home network where it connects to the ISP's network, just as ISP netw
    12·1 answer
  • How do you freeze the total cell so that it doesn't change when copied?
    6·1 answer
  • The foundation of secure communication on the internet replies on asymmetric encryption, with the use of Public and Private keys
    10·1 answer
  • If String str = "Computer Science";, then what is the value of str.substring(10);? ​
    6·1 answer
  • Mavis is considering signing up for a hosted enterprise software solution for her small business. She recognizes that an advanta
    15·1 answer
  • What are the impacts of mobile phone?as well as the positive and negative impacts?​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!