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)- A6% (3)
- B78% (38)
- C12% (6)
- D4% (2)
Community Discussion
No community discussion yet for this question.