Lesson 19: C Programming - strncpy - you provide the number of character to copy.

preview_player
Показать описание
This C program creates a character array called temp with a size of 6 characters (5 characters plus a null terminator). It then uses the strncpy() function to copy the first 5 characters of the string "abcdef" to the temp array.

strncpy() does not guarantee null-termination of the destination string.

@SoftwareNuggets #softwareNuggets #softwareNuggetsShorts #cprogrammingshorts
Рекомендации по теме