All challenges
Multiple ChoiceBeginner 30s

malloc Failure

After malloc, you should:
Options
  1. 1Cast the returned pointer to int before use
  2. 2Check the returned pointer for NULL before use
  3. 3Zero the pointer with = 0 before any later use
  4. 4Free the pointer right after the allocation call

Think you can answer under pressure?

Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.

Play this in a 3-minute battle