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
Lesechka [4]
3 years ago
8

In this lab, you will implement your own dynamic memory allocator (heap manager) in C. We will use the simple (but somewhat inef

ficient) free list system of heap allocation. You will demonstrate how to use your allocator to allocate dynamic memory for a variety of C types.
Computers and Technology
1 answer:
Vera_Pavlovna [14]3 years ago
5 0

Answer:

#include <stdio.h>

#include <stdlib.h>

 

int main()

{

   int *iVar;

   char *cVar;

   float *fVar;

     

   /*allocating memory dynamically*/

     

   iVar=(int*)malloc(1*sizeof(int));

   cVar=(char*)malloc(1*sizeof(char));

   fVar=(float*)malloc(1*sizeof(float));

     

   printf("Enter integer value: ");

   scanf("%d",iVar);

     

   printf("Enter character value: ");

   scanf(" %c",cVar);

     

   printf("Enter float value: ");

   scanf("%f",fVar);

     

   printf("Inputted value are: %d, %c, %.2f\n",*iVar,*cVar,*fVar);

     

   /*free allocated memory*/

   free(iVar);

   free(cVar);

   free(fVar);

 

   return 0;

}

You might be interested in
Is an electronic scavenger hunt played around the world.
pogonyaev
It can be played around the world
4 0
4 years ago
Print Job Cost Calculator (10 points)
Ad libitum [116K]

Answer: Provided in the explanation section

Explanation:

Provided is the code  to run this program

Source Code:

import java.util.Scanner;

class PrintJobCost

{

  public static void main(String[] args) {

      Scanner input=new Scanner(System.in);

      System.out.print("Enter print job info:");

      String info=input.nextLine();

      String size="",type="";

      int count=0,i=0,len=info.length();

      double cost=0.0;

      while(info.charAt(i)!=' '){

          size=size+info.charAt(i);  

          i++;

      }

      i++;

      while(info.charAt(i)!=' '){

          type=type+info.charAt(i);

          i++;

      }

      i++;

      while(i<len){

          count=count*10+Integer.parseInt(String.valueOf(info.charAt(i)));

          i++;

      }

      if(size.equals("Letter"))

          cost=cost+0.05;

      else if(size.equals("Legal"))

          cost=cost+0.06;

      else if(size.equals("A4"))

          cost=cost+0.055;

      else if(size.equals("A5"))

          cost=cost+0.04;

      if(type.equals("Grayscale"))

          cost=cost+0.01;

      else if(type.equals("Colored"))

          cost=cost+0.10;

      cost=cost*count;

      System.out.printf("print job Cost:$ %.2f\n",cost);

  }

}

cheers i hope this helped !!!

8 0
4 years ago
How is a computer component, such as a network card, commonly marked for identification?
JulsSmile [24]
It usually is marked either with a sticker or sometimes with a stenciled mark like something.
a network card is a device which usually connects a computer to a network (LAN). A computer has two categories which make it a computer:
Hardware
Software
A network Card is from the Hardware part of the computer.  
4 0
4 years ago
____________ is demonstrated by the processes and procedures that an organization uses to meet the law.A. An auditB. SecurityC.
Feliz [49]

Answer:

D

Explanation:

because it is a administrative procedure

3 0
3 years ago
Read 2 more answers
It is possible to have motion in the absence of a force
den301095 [7]
Yes, motion continues after forces are no longer being applied. Otherwise, a ball wouldn't continue to roll after it left your hand.
No, gravitational forces from every piece of matter in the universe affect every other piece of matter in the universe. Gravity cannot be blocked.
6 0
3 years ago
Other questions:
  • Which trait depicts honesty?
    10·1 answer
  • If you were looking for a record in a very large database and you knew the ID number, which of the following commands would be t
    10·1 answer
  • As an IT tech for your company, you have been notified that the Windows domain does not seem to be functioning properly. Being f
    7·1 answer
  • Write a program named ArrayDemo that stores an array of 10 integers. (Note that the array is created for you and does not need t
    14·1 answer
  • Unscramble the words <br><br> A: ESUOM RETUPOC <br><br> B: KSID EVIRD
    12·2 answers
  • Software is the word for:
    15·1 answer
  • Identify an advantage of the software as a service (SaaS) approach in public cloud computing. Group of answer choices The user h
    5·1 answer
  • Emanuel studies hard for hours on end until bedtime, yet his grades could be better. What can he do to improve his academic perf
    6·1 answer
  • Let us begin
    9·2 answers
  • In a(n) ____________________ device, the movement of electrons performs essentially the same functions as gears and wheels in me
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!