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
Harrizon [31]
2 years ago
7

Write two statements that each use malloc to allocate an int location for each pointer. Sample output for given program:

Computers and Technology
1 answer:
Mekhanik [1.2K]2 years ago
7 0

Answer:

#include <stdio.h>

#include <stdlib.h>

int main(void) {

   int* numPtr1 = NULL;

   int* numPtr2 = NULL;

   /* Your solution goes here */

   numPtr1 = (int *) malloc(10);

   numPtr2 = (int *) malloc(20);

   *numPtr1 = 44;

   *numPtr2 = 99;

   printf("numPtr1 = %d, numPtr2 = %d\n", *numPtr1, *numPtr2);

   free(numPtr1);

   free(numPtr2);

   return 0;

}

Explanation:

The C library malloc function is used to assign memory locations (in bytes) to variables. It accepts the size parameter and returns a pointer to the specified variable location.

The two malloc statements above assign two memory locations 10 and 20 to the numPtr1 and numPtr2 integer variables respectively.

You might be interested in
Etapas del desarrollo​
cestrela7 [59]

Answer:

Las etapas del desarrollo humano

Etapa prenatal. Comprende desde la concepción hasta el parto. ...

Etapa de la niñez. Es la comprendida entre el nacimiento y los tres años. ...

Primera infancia. Desde los 3 a los 6 años. ...

Infancia intermedia. ...

Adolescencia. ...

Etapa adulta temprana.

Edad adulta intermedia.

Edad adulta tardía.

Explanation:

5 0
3 years ago
What is database design?
finlep [7]

Answer: Database design is the model created of data/information for any particular organization .the relation between the information and which data is to be stored is the most important factor for designing .These parameters are decided by the designer of the database.

After the decision of the designed the data is invoked in the database .The data representation in the theoretical manner is known as ontology.The classification and relation defining is the purpose of the database design.

3 0
3 years ago
A company has a legacy application using a proprietary file system and plans to migrate the application to AWS. Which storage se
PtichkaEL [24]

A company has a legacy application using a proprietary file system and plans to migrate the application to AWS. Which storage service should the company

use is

D. Amazon EFS

Explanation:

  • A company has a legacy application using a proprietary file system and plans to migrate the application to AWS. Which storage service should the company

        use is

  • D. Amazon EFS
  • Amazon Elastic File System (Amazon EFS) provides a simple, a fully managed elastic NFS file system for use with AWS Cloud services.
  • EFS is NFS filesystem.
  • It has two storage classes,
  • the Standard storage class
  • the Infrequent Access storage class
  • Amazon EFS is highly suitable to support a broad spectrum of use cases from home directories to business-critical applications.
4 0
3 years ago
List 2 end to end test commands. <br><br> Will mark Brainliest!!
Delvig [45]

Answer:

ibm pll

Explanation:

4 0
3 years ago
Which type of presentation is best for a presentation about the benefits of aerobic exercise?
insens350 [35]
Let's go with a Microsoft office power point presentation
7 0
3 years ago
Other questions:
  • This operating system was used by individual computers an required users to type commands
    10·1 answer
  • What is a custom information field that helps users to find a specific document?
    8·1 answer
  • It is good practice, however, for policy _________________________ to solicit input both from technically adept information secu
    7·1 answer
  • A bug collector collects bugs every day for seven days. Write a program in Python that finds the highest number of bugs collecte
    11·1 answer
  • How do you fix peer answer bad gateway 502. Please help
    7·1 answer
  • (tco 7) the asp.net ajax client-side framework is loaded on the _____ for an asp.net web application.
    15·1 answer
  • Superclass in python explanation
    7·1 answer
  • A. Directions: Read the statement carefully. Write True in the space provided if the statement is correct and False if it is not
    6·1 answer
  • where element is the Hypertext Markup Language (HTML) element and _____ pairs define the styles that are applied directly to tha
    6·1 answer
  • According to behaviorism, instruction should provide necessary stimulus in order for
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!