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
Typically, what form do most database designers consider a database structure to be normalized?
klemol [59]
Hello,

Answer is Third 

Hope This Help!!!
6 0
3 years ago
Which type of software is primarily used to organize a collection of information for easy access?
weeeeeb [17]
Database - you could also use a spreadsheet but you can't ask questions that you can with a database
4 0
3 years ago
) The ________ displays a text box and button for users to browse, select, and upload a file. (Points : 3)
Vinil7 [7]
Upload text box control
6 0
3 years ago
You manage the DNS servers for the eastsim domain. You have a domain controller named DNS1 running Windows Server 2016 that hold
Ierofanga [76]

Answer:

..

Explanation:

...

3 0
3 years ago
________ is malware that hijacks a user's computer and demands payment in return for giving back access.
Lera25 [3.4K]

Ransom  malware that hijacks a user's computer and demands payment in return for giving back access.

<h3>What is Ransom malware?</h3>

This is known to be a kind of  malware that hinders users from gaining in or access to their system or personal files and it is one that often demands ransom payment so as to get access.

Therefore, Ransom  malware that hijacks a user's computer and demands payment in return for giving back access.

Learn more about Ransom  malware from

brainly.com/question/27312662

#SPJ12

6 0
2 years ago
Other questions:
  • Two columns of a relational table can have the same names. <br> a. True <br> b. False
    15·1 answer
  • True or false: although the first personal computers were available as early as the 1970's, the creation of the world wide web (
    11·1 answer
  • What are the changes in ios 14.2? What are the benefits of the ios developer program? What is next for Apple? Base your answers
    14·1 answer
  • "The OSI model has seven layers and the DoD has four. At which layer does SMTP works in both models"?
    15·1 answer
  • Which of the following sentences is correct?a. Arithmetic log unit is used to perform both integer and floating point computatio
    8·1 answer
  • Analyze the following recursive method and indicate which of the following will be true.
    7·1 answer
  • If the user does NOT click the button what color will "topButton" be when this program finishes running?
    6·1 answer
  • Suppose you decide to use the number of times you see any of the area codes of the places Yanay has been to in 50 spam calls as
    9·1 answer
  • Why would you choose a mobile device over a laptop? 1-2 sentences.
    11·1 answer
  • What does a virtual machine emulate?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!