Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: Concatenating Strings | Common String Operations
/
C Strings
Sektion 3. Kapitel 6
single

single

bookChallenge: Concatenating Strings

Stryg for at vise menuen

Opgave

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 src to the end of dest without exceeding dest_size - 1 characters in dest.
  • Ensure the resulting string in dest is always null-terminated.
  • Only append as many characters from src as will fit in the remaining space of dest.
  • Do not modify characters in dest beyond the allowed buffer size.

Løsning

Switch to desktopSkift til skrivebord for at øve i den virkelige verdenFortsæt der, hvor du er, med en af nedenstående muligheder
Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 3. Kapitel 6
single

single

Spørg AI

expand

Spørg AI

ChatGPT

Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat

some-alt