Pointers And Dynamic Memory Allocation Computer Science Homework Help

Question 1

  Dynamic MemoryAllocation that we studied this week happens at

a) Run Time

b) Compile Time

c) Play Time

d) None of the Above

Question 2

  Which is properway to use a pointer to a structure to reference the wage member?

a) (*emp_ptr).wage

b) emp_ptr -> wage

c) Both the first two answers will do the samething

d) None of the Above

Question 3

  A structure canhave a member who is declared to be a pointer to some type in C

a) True

b) False

Question 4

  Each item in alinked list is referred to as a …

a) node

b) link

c) value

d) handle

Question 5

  Which is a falsestatement about “malloc”

a) Is a function that is part of the C Library

b) Returned area in the heap is initialized to 0

c) returns 0 if unable to allocate memory in theheap

d) returns a pointer to the start of the area inthe heap

Question 6

  cfree is used toreturn back memory in the heap allocated with the malloc statement

a) True

b) False

Question 7

  Given that a is anarray name, and i is an index to that array: Which is the basic rule that suggests the relationship between pointerand arrays?

a) a [ i ] = ( * ( a + i ) )

b) i  = ( * (a + i ) )

c) a [ i ] = * i

d) a [ i ] = i

Question 8

  Given:  char a[ ] = “0123456789”; and int i= 5; … it is possible to reference i [ a ] ?

a) True

b) False

Question 9

  Which of thefollowing is the proper keyword or function to deallocate memory?

a) free

b) delete

c) clear

d) remove

Question 10

  Which of thefollowing is the proper keyword or function to allocate memory in C?

a) new

b) malloc

c) create

d) value

No matter what kind of paper writing service you need, we’ll get it written. Place Your Order Now!
× How can I help you?