Which of the following statements does not allocate a block of 100 bytes and test for an allocation failure?

A. if (ptr = malloc(100))
B. if (!(ptr = malloc(100)))
C. if (ptr = calloc(100))
D. if (!(ptr = calloc(100)))
E. if (ptr = realloc(100))


Answer: B

Computer Science & Information Technology

You might also like to view...

In macro code, each part of the complete name of a control is separated from the others using a(n) ____.

A. period (.) B. slash (/) C. exclamation mark (!) D. comma (,)

Computer Science & Information Technology

Arrow keys can manipulate a JSlider object. Which of the following statements does not correctly describe how the arrow keys are used?

a. The left-arrow and right arrow keys decrease or increase (respectively) the thumb of the JSlider by 1. b. The down-arrow and up-arrow keys decrease or increase (respectively) the thumb of the JSlider by 1. c. The PgDn and PgUp keys decrease or increase (respectively) by block increments of one-tenth of the range of values. d. The Home key and End key move the thumb to the maximum or minimum (respectively) value of the JSlider.

Computer Science & Information Technology

Which of the following traversals visits the nodes that are closer to the top of the tree before visiting those that are closer to the bottom?

Preorder b) Inorder c) Postorder d) Level-order e) none of the above

Computer Science & Information Technology

The Blank slide layout includes only a placeholder for the title

Indicate whether the statement is true or false

Computer Science & Information Technology