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
Write two sentences but each one having either computer in it or technology in it. You can use a word more than once in a senten
Ksju [112]

Answer:

Sentences:

1.My computer has a virus

2.Technology may take over the world someday

Explanation:

7 0
3 years ago
Read 2 more answers
Ms Access is spreadsheet software.True or false​
Doss [256]

Answer: I'd say false.

Explanation: An example of a spreadsheet software would be MS Excel. Access does have an option to create a spreadsheet but it also has other uses.

6 0
3 years ago
Read 2 more answers
What is the best approach to handling the expectation of privacy by employees in the event an investigation needs to be carried
Wittaler [7]

Answer

The best approach to handling the expectation of privacy by employees in the event an investigation needs to be carried out on company-owned digital assets:-<u>A well-defined published policy that clearly states that an employer has the right to examine, inspect or access company-owned assets.</u>

3 0
3 years ago
Problem 1. MST - Prim's and Kruskal's algorithms
Juli2301 [7.4K]
Or maybe not Encryption converts the data in a database to a format that is indecipherable to unauthorized users who attempt to bypass the DBMS.

a. True
b. False
7 0
3 years ago
You administer a Microsoft SQL Server environment. You purchase a new server and plan to migrate your database from SQL Server 2
Snezhnost [94]

Answer:

B. Migration Assistant

Explanation:

Migration assistant also referred to as the Data Migration Assistant (DMA) is a Microsoft tool used during SQL server upgrades to detect any compatibility issues that could impact the functionality of the new version of SQL server being installed. The Data Migration Assistant will also recommend performance and reliability improvements as well as allow you to move your SQL server data and schema from the source server to the destination server.

8 0
4 years ago
Other questions:
  • What is the slide sorter view used for?
    11·1 answer
  • You have several marketing documents that are published through AD RMS. However, you have three new marketing employees that req
    12·1 answer
  • PowerPoint displays many that are varied and appealing and give you an excellent start at designing a presentation. However, you
    15·1 answer
  • jeff wants to create a website with interactive and dynamic content. Which programming language will he use?
    11·2 answers
  • How to write a program to draw 1000 random points on a frame in python language for coding?
    13·1 answer
  • Is Missouri a free state or a slave state​
    13·2 answers
  • Matts has finished running some security automation scripts on three newly deployed Linux servers. After applying intrusion dete
    7·1 answer
  • Waygate's residential Internet modem works well but is sensitive to power-line fluctuations. On average, this product hangs up a
    6·1 answer
  • at the grocery store alexa by 1 1/3 lb of ground turkey nasha by two times as much ground turkey is alexa how much ground turkey
    9·1 answer
  • Write a program that creates a two-dimensional array named height and stores the following data:
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!