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
What devices gives input​
seraphim [82]

Answer:

keyboard and mouse is the answer

8 0
3 years ago
Dani wants to create a web page to document her travel adventures. Which coding language should she use? HTML Java Python Text
Anna [14]

Answer:

HTML, CSS, JavaScript, python, SQL

Explanation:

To create a web page for her travel adventures Dani has to use HTML and CSS to design the page's layout. A beautiful simple design such as one which shows photos of her on her travel destinations, and a paragraph for her to write a little story on her travels would do.

Dani needs JavaScript to animate the photos she's going to post on the page. Dani also should use python to build the backend of her page so she can write codes to save and access her documented adventures from the database. She should use a database language like SQL to save all of her adventures so she can view them at a later time for the memories.

7 0
3 years ago
Difference between alt tab and windows tab
Kryger [21]
Alt+Tab switches between windows instantly while Windows+Tab displays all currently active windows.
Hope this helps :D
7 0
3 years ago
What command issued from the command prompt will show the route that a packet travels from the issuing computer to another compu
svetoff [14.1K]

Answer:

B)tracert

Explanation:

Tracery Command can be regarded as

network diagnostic tool, it is used in tracking process of pathway of packet ranging from source to destination on IP network. It as well allows to know real time of each hops that are been taken by a packet as it enroutes to it's destination. The traceroute can be run by following these steps:

✓Open the run window

✓Open Command prompt, this can be done by enter "cmd" then enter.

✓ input" tracert" then destination ( Ip address or web address)

It should be noted that Tracery command issued from the command prompt will show the route that a packet travels from the issuing computer to another computer.

6 0
3 years ago
When cleaning a computer, you need only worry about what you can see.
icang [17]

Answer:

No

Explanation:

Somethimg yu cant see are important

5 0
3 years ago
Other questions:
  • How do you bookmark a website in each of the internet browsers?
    9·1 answer
  • There are four types of alignment available from on the Home ribbon toolbar. They include all of the following except
    13·1 answer
  • Ellen has eggs she wishes to trade for grain. However, she cannot find anyone with grain that needs eggs. What is missing for th
    14·1 answer
  • categorize each job role as an administrative job or management job auditor director legal secretary payroll clerk etc ​
    8·1 answer
  • You are the network adminstrator for your company your network consists of two active directory domains research.westsim.local a
    12·1 answer
  • Please help I don’t know
    5·1 answer
  • How do I use brainly.<br> What is brainliest.<br> And what is the rating thing about
    6·2 answers
  • Select the correct answer. Which symbol denotes markup tags? A. {} B. &lt; &gt;. C. ( ) OD. [] ​
    7·1 answer
  • Nearly all social software systems include a(n) ________, which helps control your information flow.
    6·2 answers
  • Which programming paradigm focuses on abstraction to the level of math and the elimination of side-effects and state based progr
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!