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]
3 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]3 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
The vast amount of data collected from Internet searches, social media posts, customer transactions, military
Brums [2.3K]

Answer:

A. Big Data

Explanation:

It is big data. The internet searches, customer transactions, social media posts, medical tests, weather sensors, military surveillance, and all the data source you are seeing around yourself forms together with the big data. And a big social media company gathers around so many petabytes of data each day. And there are so many such companies, plus all sorts like eLearning sites, etc. And all these together form the big data.

3 0
4 years ago
Is it possible to code your own game and if so then where should I go to learn and how to publish it?
const2013 [10]

Answer:

Yes there is

Explanation:

It is scratch a coding game to do almost anything you can also code flappybird

Hope this helps.

Have fun with scratch

4 0
2 years ago
Read 2 more answers
What is the purpose of system software?
suter [353]
"To preform specific useful computing tasks, like word processing and calculation" is the correct answer. This is the whole purpose of system software. The third answer is some other type of software(third party software?) and the fourth answer is most likely a compiler. Those are the easiest to take off. The second could also work.

The two answers I would go with are the first and the second.
8 0
3 years ago
What do you think of the extensive use of the non-diegetic sound in Return of the Jedi (1983)?
Jobisdone [24]

FOR ANYONE THAT WANTS TO STUDY AND CHILL SCREENSHOT BEFORE KATLE DELEATES THIS

meeting id:  932-8097-2909

password:  z99LtX

Explanation:

4 0
3 years ago
According to the mil-std-6016 what are the requirements for information to be passed between and among joint forces and organiza
mixas84 [53]

Based on  mil-std-6016, the requirements for information to be passed between and among joint forces, along with the technical interfaces is called Joint Tactical Operations (JTO) Procedural Handbook.

<h3>What is Joint Tactical Operations (JTO) Procedural Handbook?</h3>

This is known to be a book that contains all  the provisions that is needed by system operators along with some technical parameters and tactical procedures.

It is often used  for the exchange of near real-time data through TDL and it is known to be set up to function on console in the time of joint service operations and exercises.

Learn more about military from

brainly.com/question/525279

6 0
2 years ago
Other questions:
  • 10. Which of these is not an HTTP verb? PUT AJAX GET DELETE
    12·1 answer
  • How many buttons does a gamecube controller have?
    7·1 answer
  • An individual who understands and uses a variety of symbols yet uses one symbol at a time to share a message needs more developm
    10·1 answer
  • How would you define media literacy?
    12·1 answer
  • Which of the following helps create a positive community?
    11·1 answer
  • What is the orbit? Define
    12·1 answer
  • Multiple choice:
    12·2 answers
  • Office 365 ProPlus can be deployed to your enterprise. When doing so, which tool enables you to choose the language, hardware ar
    5·1 answer
  • Instruction: Decide what the total marketing budget will be, and make a list of at least four things you will spend money on and
    15·1 answer
  • Who is willam afton from five nights at freddy
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!