Skip to content
0:00 / 0:00

#c#strings#stringview

C Strings are Terrible!

Tsoding

165K subscribers • 25 videos on Hallway

YouTube
  • Recommended by 1 person: 1 in engineering communities.
  • Linked in the descriptiontsoding/donate
  • An opinion. It argues one side of a question engineers disagree on.

Intermediate. Assumes working knowledge.

270K views7 months ago1 recommendation

Programming languagesSystems programmingCMemory managementData structures

Alexey Kutepov demonstrates the drawbacks of null-terminated C strings and builds a custom string view paradigm to handle text more safely.

Support: github.com/tsoding/donate Chapters: - - C strings - - Advantage of C strings - - Drawbacks of C strings - - String Views - - Conversion between C strings and String Views - - Printing String Views - - Mass Choping - - Trimming Spaces - - Splitting by Delimiter - - Better Printing of String_View - - Slopreading a File - - Analyzing Lines - - Analyzing Words - - The Power of the Paradigm - - C strings are Infrastructure Source Code: gist.github.com/rexim/2bc46ae1aa18b9d05a4b3316f4f1aa1f

Why it's here

1 person recommends this

What people say. Recommended as a great demonstration of handling C strings and implementing a string view paradigm.

u/grimvianin r/C_Programming • Recommends

Tsoding - C Strings are Terrible! - not beginner stuff Again a great video from Tsoding about handling C strings. I really like C strings and making functions manipulate C strings. [video

u/simon-or-somethingin r/C_Programming • Mentions

On “Dynamic help in C required”

…->start = 0; s->length = len; s->cap = len; memcpy(s + 1, str, len); return (s + 1); } This is one option, another is to have a custom string struct with everything, or you compile with g++ / compile it as a c++ source file using `std::string` tsoding has a video on that, in general tsoding is great for C programming: link to this video…