Question
Explain the use of the string library functions strncpy() and strncat(), with the help of an example for each.
Answer :
Word Count : 223
__________ ______ ________ _________ _______ ______ _______ ____ ___ __________ ___ _________.
_______ ________ _____ _________ ______ _____ _______ ___ ____.
___ _____ __________ _______ ______ ____ ___ ___ ___ ____.
______ _______ _______ _______ _________.
_______ _____ _____ __________ ______ ________ ____ ___ ________.
_________ _______ __________ ________ ______ ________ ______.
______ _______ ___ _____ _______ __________ _________ ____ ________ _________.
______ _______ ___ _________ _________ _______.
______ ________ ___ ________ _________.
______ __________ ____ _______ ___.
___ ________ _______ _______ _____ ____ ___.
_____ ____ ______ _____ _______.
________ ______ ___ _______ ________ ______ ___ _______ _________ _______ _________.
___ _________ _____ ____ ______ ___ ______ ________ _________ ________.
_________ ____ ____ _____ __________.
___ _____ ________ ______ _________ ________ ________ _________ _____ ______.
________ _____ ______ _________ ___ ______ ______ ____ ________ _____ _______ ____.
______ __________ ____ ______ _______ __________ _________.
________ ______ ___ _______ _______ ________ _______ ____.
___ ______ ________ ______ ________ _____ ________ __________ _____ _____ __________.
___ ___ ____ _____ _______.
Skip in 10
The `strncpy()` function is used to copy a specified number of characters from one string to another. It ensures that no more than `n` characters are copied, making it safer than `strcpy()`, which does not limit the number of characters. If the source string is shorter than `n`, the destination string is padded with
_______ ________ _____ _________ ______ _____ _______ ___ ____.
___ _____ __________ _______ ______ ____ ___ ___ ___ ____.
______ _______ _______ _______ _________.
_______ _____ _____ __________ ______ ________ ____ ___ ________.
_________ _______ __________ ________ ______ ________ ______.
______ _______ ___ _____ _______ __________ _________ ____ ________ _________.
______ _______ ___ _________ _________ _______.
______ ________ ___ ________ _________.
______ __________ ____ _______ ___.
___ ________ _______ _______ _____ ____ ___.
_____ ____ ______ _____ _______.
________ ______ ___ _______ ________ ______ ___ _______ _________ _______ _________.
___ _________ _____ ____ ______ ___ ______ ________ _________ ________.
_________ ____ ____ _____ __________.
___ _____ ________ ______ _________ ________ ________ _________ _____ ______.
________ _____ ______ _________ ___ ______ ______ ____ ________ _____ _______ ____.
______ __________ ____ ______ _______ __________ _________.
________ ______ ___ _______ _______ ________ _______ ____.
___ ______ ________ ______ ________ _____ ________ __________ _____ _____ __________.
___ ___ ____ _____ _______.
IGNOU ACADEMY
Your IGNOU journey, made easier.
- Solved Assignments
- Study Notes
- Guess Papers
- Question Papers
Continue Reading — It's Free
Sign in with Google to unlock more of this answer.
✓ Free access
✓ Unlock up to 60% of the answer
✓ No payment required
✓ Unlock up to 60% of the answer
✓ No payment required
Quick Google sign-in. No separate registration form.