Strings in C | Q - 8

Last Updated :
Discuss
Comments

What is the issue with this code?

C
char str[5];
strcpy(str, "hello");


No Issue

strcpy is deprecated

"hello" has 6 characters (including null terminator), but str can only hold 5

str must be initialized

Tags:
Share your thoughts in the comments