nerdexam
EC-Council

312-92 · Question #11

What type of error will result from the following statement? int main(int argc, char* argv[]) { char i[7]; strncpy(i, "sdfusdofof", sizeof(i)); }

The correct answer is B. Null-termination. See the full explanation below for the reasoning.

Question

What type of error will result from the following statement? int main(int argc, char* argv[]) { char i[7]; strncpy(i, "sdfusdofof", sizeof(i)); }

Options

  • AUnbounded string copy
  • BNull-termination
  • CString-termination
  • DString truncation

How the community answered

(49 responses)
  • A
    6% (3)
  • B
    78% (38)
  • C
    12% (6)
  • D
    4% (2)

Community Discussion

No community discussion yet for this question.

Full 312-92 Practice