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
makvit [3.9K]
3 years ago
15

Given the variable ip, already declared as a pointer to an integer, write the code to dynamically allocate memory for a single i

nteger value, assign the resulting pointer to ip, and initialize the integer value to 27.
Computers and Technology
1 answer:
stepan [7]3 years ago
8 0

Answer:

In C++:

int *ip;

ip = new int;

*ip = 27;

Explanation:

First of all, let us have a look at the methods of memory allocation to a variable.

1. Compile Time: The memory gets allocated to the variable at the time of compilation of code only. It is also called <em>static </em>allocation of memory.

Code example:

int a = 5;

2. Run Time: The memory is allocated to the variable <em>on the fly </em>i.e. during the execution of the program. It is also called <em>dynamic </em>allocation of memory.

Now, we have to write code for a variable ip, which is an integer pointer to dynamically allocate memory for a single integer value and then initialize the integer value 27 to it.

Initializing a variable means assigning a value to variable for the first time.

Writing the code in C++ programming language:

<em>int *ip;</em>      // Declaring the variable ip as a pointer to an integer

<em>ip = new int;</em>    // Dynamically allocating memory for a single integer value

<em>*ip = 27;  </em> // Initializing the integer value to 27.

You might be interested in
Consider the following scenario: "You are an assistant to the accounting manager for a small company that sells sports equipment
Rzqust [24]

Answer:

1. Microsoft Excel helps data analysis through different spreadsheet queries and operations options.

2. Input data to the analysis of sales by product is required for the development of formula and extracting results.

3. The information of data source and frequency of report is required to start the work.

Explanation:

1. Microsoft Excel tool can be used to calculate the results of equipment. Obtained results can be displayed in charts and graphs from the excel.

2. Information like the quantity of sold items, remaining items are required to produce accurate, useful analysis.

Before starting assignment accounting manager will be asked the following questions.

1) Where does the input data come from?

2) Is analysis required on a daily basis or once for all provided data?

3) Is Summary is in the form of tabular data, Graphical data, or Both?

4 0
3 years ago
What is the gauge manifold made of
zzz [600]
I think it is.. the low side handwheel is made of blue plastic or occasionally has a blue decal in its center  then the high side handwheel is made of red plastic or occasionally has a red decal gauges used with a refrigeration gauge manifold are either analog which resemble other pressure gauges or perhaps digital.... i hope this helps :)
5 0
3 years ago
We can include following item(s) during configuration itemidentification:
Ainat [17]

Answer:

d) All of the above

Explanation:

In configuration management, the Identify configuration items, work products and related components are present.

  • All the documents which are related to the work,the manuals how that the system works are present in the configuration item identification.
  • The source code that is implement for the functioning of the products.These are implemented at the time of generation of products.
  • Software Requirement Specifications are also specified by SRS it is present in design stage of software development life cycle,it is also a part of configuration item identification.
5 0
3 years ago
with the current computer development, explain 5th areas where computer is applied for the social economic dwvelopment in societ
AleksandrR [38]

Explanation:

just want points tbh but have a good day

7 0
3 years ago
4. The NIMS Management Characteristic of Chain of Command and Unity of Command means that each person: A. Continues to report di
Kipish [7]

Answer:

The answer is "Option C"

Explanation:

This system facilitates the establishment by state, Municipality, Militaristic, Provincial and local governments of a detailed, national framework for disaster response. This command structure of each person refers to only a single ICS boss because of NIMS management, and the wrong option can be defined as follows:

  • In option A, The Continuous report describes your daily details.
  • In option B, These reports are not in one ICS supervisor.
  • In option D, It can not assign different competences.
8 0
3 years ago
Other questions:
  • What is another name for “low-angle lighting”? Side lighting Top lighting Under-lighting Three-point lighting
    15·2 answers
  • What has prompted schools to add Internet activities in their academic integrity policies?
    11·2 answers
  • How many homes can be warmed by one bugatti
    11·2 answers
  • Write a full class definition for a class named Averager, and containing the following members:______An data member named sum of
    6·2 answers
  • When you start to type =av, what feature displays a list of functions and defined names?
    11·1 answer
  • What is the description of a computer ram?
    7·1 answer
  • What is data? why is it important to collect data ? explain the points.​
    10·1 answer
  • is a security design principle to direct the selection of control layers for an organization's computing enclave to ensure its r
    6·1 answer
  • Create a Flowchart and write pseudocode for a program that allows the user to enter two integer values: a and b.
    8·1 answer
  • 6
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!