Sectie 3. Hoofdstuk 6
single
Challenge: Concatenating Strings
Veeg om het menu te tonen
Taak
Swipe to start coding
Practice concatenating strings safely in C by implementing a function that appends the contents of one string to another, making sure not to exceed the destination buffer's size and always ensuring the result is null-terminated.
- Append the contents of
srcto the end ofdestwithout exceedingdest_size - 1characters indest. - Ensure the resulting string in
destis always null-terminated. - Only append as many characters from
srcas will fit in the remaining space ofdest. - Do not modify characters in
destbeyond the allowed buffer size.
Oplossing
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 3. Hoofdstuk 6
single
Vraag AI
Vraag AI
Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.