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

Answers

Answer 1

Answer:

In the following code, you can see the usage of malloc.

#include <stdio.h>

#include <stdlib.h>

int main(void) {

  int* numberPointer1 = NULL;

  int* numberPointer2 = NULL;

  numberPointer1 = (int *)malloc(sizeof(int *));

  numberPointer2 = (int *)malloc(sizeof(int *));

  *numberPointer1 = 44;

  *numberPointer2 = 99;

  printf("numberPointer1 = %d, numberPointer2 = %d\n", *numberPointer1, *numberPointer2);

  free(numberPointer1);

  free(numberPointer2);

  return 0;

}

Explanation:

Malloc allocates memory in the heap according to the input size and returns a pointer to the location where it was allocated, with an extra, it clears all allocated space.


Related Questions

Given storeMonthlySales NUM STOREST[NUM MONTHST[NUM DEPTS] is a three-dimensional array of floating point values. Write a C++ function, printMonthlySales, to calculate and print the total value of sales during a specific month by each department and in each store plus totals by store and department and overall sales. The return type of the function is void and the function must have 2 input parameters Sales array and the month the user specified (edit for correct month values!). The constants NUM STORES, NUM_MONTHS, and NUM_DEPTS must be accessed globally by defining the following global variables #define NUM DEPTS 2 #define NUM STORES 2 #define NUM-MONTHS 12 or const int NUM-MONTHS-12; or const in NUM_DEPTS 2; or const int NUM_STORES 2; The array Sales is initialized by the following statement within main() float storeMonthlySales[NUM STOREST[NUM MONTHS1[NUM DEPTS]- 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1,3.2, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 4.1, 4.2, 2.1, 2.2,2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2 Output: Sales for month of value (where value represents "January", "March", etc.) Dept # value value col value sum Dept # Store Total Store # value row value sum tore # value row value sum Dept Total col value sum total overall sales User enters a new month as many times as they wish and run printMonthlySales against the new month alue Validate user input ("y" or "n") when asking if the user wants to enter a new set of values

Answers

Answer:

Y

Explanation:

YEZ

Hands-On Project 15-4 Make Network Cables
Using the tools and skills you learned about in this chapter, practice making a straight-through cable and a crossover cable. Use a cable tester to test both cables. Answer the following questions:
1. Which wiring standard did you use for the straight-through cable? List the pinouts (pin number and wire color) for each of the eight pins on each connector.
2. Will your crossover cable work on a Gigabit Ethernet network? List the pinouts (pin number and wire color) for each of the eight pins on each connector.

Answers

Answer:

1. You can use either standard (T-568A or T-568B) - but must keep the standard throughout the installation (can't mix A with B).

The B standard is preferred in the US.  A is mostly used overseas (Europe)

For A the proper wiring sequence is:

1 - Orange/White

2 - Orange

3 - Green / White

4 - Blue

5 - Blue / White

6 - Green

7 - Brown / White

8 - Brown

2. Cross over connections use a different pinout for one side of the cable.  The second side is wired normally.

Crossover connections are only used for device to device connections.  ( as in the case of connecting two NIC cards together directly).  They will not work if plugged into a switch or other network device.

Normal side - use the pinout from question #1

Crossover side:

1 Green / White

2 Green

3 Orange / White

4 Brown / White

5 Brown

6 Orange

7 Blue

8 Blue / White

Explanation:

What is the result when you run the following line of code after a prompt >>>print(“2+4)

Answers

Answer:

2+4

or more honestly, it would return an error message.

Explanation:

So none of the answers are correct because:

no quotes will be printed.If you look more closely, the quotes are inversed in the statement, which is invalid syntax.

see picture

Answer:

the answer is

'2 + 4'

Explanation:  

I just took the test, so I know for 100% certainty, that this is the answer that is being accepted as the correct answer.  

1. The trucks hauling asphalt have a maximum capacity of 5 US tons (10,000 lbs) 2. The standard road lane is 12 feet wide. 3. Asphalt weighs 150 lbs per cubic foot 4. Asphalt costs $200 per ton 5. Power and water utilities are run in a conduit pipe under the road as part of all road projects 6. Conduit pipe is available only in 24 ft. lengths - each length costs $500 7. There is one intersection for every mile of road a. a 1 mile road has 1 intersection b. a 2 mile road has 2 intersections c. a 2.99 mile road has 2 intersections 8. Stoplights cost $25,000 per light 9. Each intersection has two stoplights, plus one additional stoplight for each lane a. a 1 lane road has three stop lights at each intersection b. a 2 lane road has four stop lights at each intersection c. a 3 lane road has five stop lights at each intersection 10. Work days are 8-hour days 11. All workers are paid $25 per hour12. Crew members can complete an amount of work in a specified time according to the equation below: crewMember = 50 . miles . lanes/days Test Data Test #1 Given Inputs Length of road project (miles) : 2.75 Number of lanes 3Depth of asphalt (inches) 12 Days to complete project 30Expected Output - Amount of materials needed === Truckloads of Asphalt : 7841 Stoplights : le Conduit pipes : 605 Crew members needed : 14 = Cost of Materials ============ Cost of Asphalt : $7841000.ee Cost of Stoplights : $250000.00 Cost of Conduit pipes : $302500.ee Cost of Labor : $84882.ee - Total Cost of Project - Total cost of project : $8477500.ee

Answers

Answer:

please write in a better way, and make it easy for us to read.

how do i chose the brianliest answer

Answers

Answer:

you can choose the brainliest answer by clicking in a brainliest answer

Answer:

Click on the answer, then click brainliest

Explanation:

What is this tool called?
*

Answers

Answer:

what tool?

Explanation:

It’s called a asterisk in math it’s also used for multiplication

In Word, blue underlining indicates which of these problems?
A grammatical error
B file error
C spelling error
D style mismatch

Answers

Answer:

The blue indicates a grammatical error, including misused words.

Hence, the answer is A

What is the name for the strip of frequently used icons on a computer? O App O Program O Toolbar O Utilities panel ILL MARK YOU BRAINEST​

Answers

Answer: The name of the strip is the Toolbar.

Answer:

its quite obvious toolbar

Explanation:

What does the measurement tell you?

Estimate at completion

Answers

Answer:

forecasted cost of the project, as the project progresses/"The expected total cost of completing all work expressed as the sum of the actual cost to date and the estimate to complete." - PMBOK Guide

Explanation:

Measurement tells u the accurate measure of something

Compare a Wi-Fi hotspot with a cybercafé.

Answers

Answer:

A WiFi Hotspot is a wireless internet connection that allows a computer, smartphone, or any other internet-enabled devices to connect to internet access points.

A cybercafe refers to any business place that allows people to access the internet usually within its premises after paying for connection access to connect to it.

Explanation:

3.3 Code Practice: Question 1
Instructions

Test if a date is a payday based on the day of the month (15th or the 30th).
Sample Run

Enter today's day numerically: 17
Sorry, not a payday.
Enter today's day numerically: 30
It's payday!

please help in python!

Answers

Answer:

date = int(input("Enter today's day numerically: "))

if date == 15 :

 print("It's payday!")

elif date == 30 :

 print("It's payday!")

else:

 print("Sorry, not a payday.");

Explanation:

The program illustrates the use of if-conditions

The program in Python where comments are used to explain each line is as follows:

#This gets integer input for day

day = int(input("Enter today's day numerically: "))

#This checks if day is 50 or 30

if day == 15 or day == 30:

   #If yes, this prints payday

   print("It's payday!")

#If otherwise

else:

   #If otherwise, this prints not a payday

   print("Sorry, not a payday.")

At the end of the program, the program outputs payday or not a payday; depending on the input from the user

See attachment for sample run

Read more about Python programs at:

https://brainly.com/question/22841107

If the VLOOKUP function is used to find an approximate match, what will it return if there is no exact match?
the largest value in the table
the smallest value in the table
O the largest value that is less than the lookup value
the smallest value that is greater than the lookup value

Answers

Answer:

Its C

Explanation:

The largest value that is less then the lookup value

Fill in the blank
What is the output of this program?
age = 4
if age > 5
print("more")
else
print("less")
Output:

Answers

age = 4

if age > 5:

print("more")

else:

print("less")

Answer: Less

Explanation: 4 is less than 5, so it will print less. I just tried it out on PyCharm.

Which of these statements are true? A. You can select all the items in the section of the menu. B. In the center section of the menu only one item can be selected at a time. C. Details is selected. D. Thumbnails, tiles, icons, and list are selected.

Answers

Answer:

In the center section of the menu, only one item can be selected at a time.

Details is selected

Explanation:

Bernie is an aspiring video game developer. Learning which of the following software would benefit him the most?

A. Computer-aided design software

B. Sampling software

C. 3-D animation software

D. System software

Answers

Answer:System Software

Explanation:

3-D animation software is for 3d animation

Sampling software is for audio

Computer aided design is an artistic media

A video game developer is is a software developer and is specialized in video game development. It relates to the creation of video games. The video game publisher have maintained a studio. And it involves 3rd party developer.

For making the games he needs 3D animated software such as shade 3D or K-3D. In order to make the game he needs to have all automation software that provides him the visual effects.

Hence the option C is correct.

Learn more about the aspiring video game developer.

brainly.com/question/21539732.

Difference between entropy and enthalpy is

Answers

Answer:

Explanation:

Enthalpy is the measure of total heat present in the thermodynamic system where the pressure is constant. Entropy is the measure of disorder in a thermodynamic system.

It is common practice not to store user’s password in clear text. However, if an attacker has seized control of the password database, he is likely already capable of modifying any user data on the site as an administrator. Why bother hashing the passwords then?

Answers

Answer:

To prevent leakage of user's passwords.

Explanation:

I don't really know the premise of your question, but I assume it is this. If the hacker has access to the user's data, they may have the email address. If they cannot crack the password hash, then they may not attempt to login to the user's accounts on other websites.

How can you crop a photo in PowerPoint?

Answers

Answer:

Yea

Explanation:

jus click on the image and it should give you the option to crop it :)

Yes by clicking on the picture and selecting crop image

Write an expression using Boolean operators that prints "Special number" if special_num is -99, 0, or 44.

Sample output with input: 17
Not special number

Answers

Answer:

special_num = int(input())

if  special_num == -99 or special_num == 0 or special_num == 44:

   print('Special number')

else:

   print('Not special number')

Explanation:

#get input

special_num = int(input())

#if function to evaluate true or false(aka Boolean)

if  special_num == -99 or special_num == 0 or special_num == 44:

#true evaluation

print('Special number')

#false evaluation

print('Not special number')

The program evaluates the number inputted by a user, checks if it is one of three special numbers and displays the appropriate message. The program is written in python 3 ;

special_num = int(input('enter number : '))

#allows user to input an integer value which is assigned to the variable named special number

if(special_num == -99) or (special_num ==0) or (special_num == 44):

#checks if the inputted value is one of the three special numbers using the assignment operator '==' and 'OR'

print('special number')

# if the condition evaluates to true, display the message ;special number

else :

print('Not a special number')

#if otherwise, display the message, not a special number.

Learn more :https://brainly.com/question/18929518

What was the biggest problem with the earliest version of the internet in the late 1960’s?

Answers

Networks couldn't talk to each other. The TCP/IP protocol could only be used in universities, governments, and businesses.

Answer:

Google didn't exist

Explanation:

Google was born in 1998 so a bunch of things were a problem

which team member on a project typically enjoys solving difficult problems? ILL MARK BRAINEST​

Answers

Answer: the programmer.

Explanation: I did the test you used the picture on

Answer:

whats THE ANSWER IS HER WRONG

Explanation:

Which questions do you need to ask yourself when preparing for a presentation?​

Answers

Answer:

What do I want to transmit?

Why am I going to present this topic?

What is my believe about this topic?

Who am i going to speak to?

What do I need to work on to convey successfully the topic?(structure, tools, abilities, visual tools)

Explanation:

These are the most important questions, first of all because you have to start with why you are doing the presentation, and what will you do to make the presentation part of your beliefs.

Which of the following occupations is least likely to involve use of a computing device on a day-to-day basis?

Janitorial duties
Cashier in a bank
Journalist
Records clerk in a hospital

Answers

Answer:

Janitorial duties

Explanation:

Can some one help me plz

Answers

Answer:

ONE

Explanation:

The output is one if x is equal to 9 % 2

There’s a scientific theory out there that says that our brain uses an algorithm to create our thoughts and it’s called the Theory of Connectivity. This theory suggests that information comes into our brains, is processed, stored, and then results in an output. Does this process sound familiar to you? In what ways do our bodies take in input and respond, sometimes without our control? Give two examples

Answers

Answer:

1. Yes, the process sounds familiar to me. It looks like the mechanism of operation of the computer.

2a. Through reflex actions, our bodies take in input and respond sometimes without our control.

b. Two examples are sneezing and the scratch reflex.

Explanation:

The principle of the theory of connectivity which involves the input, processing, storage, and output of results is similar to the workings of the human body which has to accept input from the external surroundings which it processes and provides an output for. Reflex actions are involuntary actions made in response to a stimulus. When the body receives the input, the response is made most times before we are aware of it.

Scratch reflex occurs when the sensory neurons located on the periphery of our skins are activated due to stimuli that could be in the form of touch, an insect bite, etc. Sneezing is another example of a reflex action.          

Answer:

The process does sound familiar to me; it is like the mechanism of operation of the computer. Through reflex actions, our bodies take in input and respond sometimes without our control, such as shivering, blinking, and sneezing.

Explanation:

When collecting digital evidence from a crime scene, often the best strategy for dealing with a computer that is powered on is to:

Answers

Options:

a. remove the hard drive

b. transport it while running

c. perform a clean shutdown

d. unplug it

Answer:

d. unplug it

Explanation:

Indeed, unplugging the computer often the best strategy for dealing with a computer that is powered on so to preserve (or collect) digital evidence. By so doing it allows the investigator to safely check through the computer found at the crime scene.

However, if the investigator decides to remove the hard drive or performing a clean shutdown, valuable evidence may be lost as a result. Also, transporting it while running isn't going to be a viable option.

What was the biggest problem with the earliest version of the internet in the late 1960’s?

Answers

Answer:

Explanation:

1.security issue

2. Computers were too big

3. Not very reliable

4. Networks couldn't talk to each other

5. Only be used in universities, governments, and businesses

What is a class in CSS?
A.a grouping of HTML tags for which style properties can be declared
B.a selector used to define a unique style
C.a tag used to apply styles to a block of content
D.the part of a declaration describing the type of style to be applied

Answers

I think is B not positively sure tho

Answer:

A grouping of HTML tags for which style properties can be declared

Explanation:

CORRECT

Write a java program that accepts the ingredients for a recipe in cups and converts to ounces

Answers

Answer:

Explanation:

public static int cupsToOunces (int cups) {

   

       int ounces = cups * 8;

       return ounces;

       

   }

This is a very simple Java method that takes in the number of cups in the recipe as a parameter, converts it to ounces, and then returns the number of ounces. It is very simple since 1 cup is equal to 8 ounces, therefore it simply takes the cups and multiplies it by 8 and saves that value in an int variable called ounces.

write a dialogue between two friends who are debating on popularity or property​

Answers

Answer:

example:

James said, " popularity isn't the important. "

David said, " It is ."

Other Questions
Complete the following statement. Use the integers that are closest to the number in the middle.Attachment Below Need Help! A line has a slope of 4 and goes through the point (5,2). What is the equation of this line in Standard Form?4x+y=184x+y=184x+y=184x+y=22 -(6k+5) Need help simplify this expression plz FIRST TO ANSWER GETS 30 POINTSClassify the following as physical, biological, applied science1. Chemistry 7. Parasitology2. Zoology 8. Volcanology3. Engineering 9. Genetics4. Metallurgy 10. Pasteurization5. Medicine 11. Aviation6. Microbiology 12. Bacteriology Study the image of an air mass.Which major type of air mass is moving into the area?maritime polarcontinental polarmaritime tropicalcontinental tropical 3. How will Healy try to persuade her readersthat her claim about social media is right? (Aclaim is a key point that a writer wants his orher readers to believe.) PLZ HELP! The BEST answer gets the brainiestSelect the correct location.Identify the Mesopotamian civilization on the map. If u answer this u will be marked as brainliest. Whats the weirdest smell you have ever smelled? Element Rand Element Q have the same number of valenceelectrons. These elements both have similar chemical behavior, butElement R has fewer energy levels than Element Q. Which statement bestdescribes the positions of the two elements in the periodic table? Write an expression for the difference of a number and ten What piece of equipment is used to measure mass? Which two teenagers are most likely to abstain from entering a sexual relationship?Carter follows a religion that does not approve of sexual relationships before marriage.Kai has friends who are almost all in sexual relationships.John watches sitcoms that reinforce sexual relationships.Nikki is from a culture where sex before marriage is considered immoral.Chris has an older brother who has multiple sexual partners. please help me, I cant faill!!! Select the correct answer. What is an advantage of discussing a topic or complex task with a group? A. It makes you maintain a specific role throughout the discussion. B. It shows you how to follow group discussion instructions. C. It allows you to explore points of view that differ from your own. D. It gives you an opportunity to have a conversation with friends. Please someone answer this for me please help me please and thank u Subtract. 1 2/5(3/5)Enter your answer, in simplest form, in the box.HELP PLEASE CYRIN RN :'( \_(-_-)_/ 1. Cul es el objetivo de esta carta?(A) El control inmediato de los perros abandonados(B) Un conocimiento del carcter de los perros(C) Un mejor amaestramiento de las mascotas(D) Una solucin para la creciente sobrepoblacin de losperros Prove tanAsinA + cosA = sec A Please help answer this ;)!