--:--









Quiz for Standard string functions strcpy

Course: C Language | Subject: Unit 5 | Topic: Arrays and Strings



Logo

Q1: What is the primary purpose of the strcpy() function in C?

Logo

Q2: Which header file must be included to use strcpy()?

Logo

Q3: What happens if the destination array in strcpy() is smaller than the source string?

Logo

Q4: Which of the following is the correct syntax of strcpy()?

Logo

Q5: What does strcpy() return?

Logo

Q6: If src = "Hello" and dest is empty, after strcpy(dest, src) what will dest contain?

Logo

Q7: Can strcpy() copy partial strings?

Logo

Q8: strcpy(dest, "ABC"); strcpy(dest, "XYZ"); What will dest contain?

Logo

Q9: What is a safe alternative to strcpy() to avoid buffer overflow?

Logo

Q10: What will be the result of strcpy(dest, dest)?

Logo

Q11: What does strcpy() do with the null terminator from the source?

Logo

Q12: Which is correct: strcpy(str1, str2) assumes that str1 is?

Logo

Q13: If src = "AB" and dest has size 2, what happens after strcpy(dest, src)?

Logo

Q14: strcpy(s1, ""); What will s1 contain?

Logo

Q15: What is the complexity of strcpy()?

Logo

Q16: Is strcpy() case sensitive?

Logo

Q17: What happens to the destination string if source is shorter than previous content?

Logo

Q18: Which function is better to use for secure copying in C11 standard?

Logo

Q19: Which of these is NOT a valid use of strcpy()?

Logo

Q20: If you want to copy only first 5 characters of a string, which should you use?

Are you ready to start test? Set your time limit