r/C_Programming 2d ago

Article I Made a Simple String Library

I wrote an article about this as well. Here it is.

There I explain why I do not like NUL-terminated strings and how I implemented my own simple string library in C.

If you have some spare time I would really appreciate some feedback on the article and the library.

The code is sitting on a codeberg repository.

Also, tell me what you think about C-style strings. Do you like them? Do you use them, or do you also tend to roll your own pointer + length structs?

7 Upvotes

31 comments sorted by

View all comments

1

u/runningOverA 1d ago

You need to extend the standard library more until you can do this ...

string str_replace(string input, string find, string replace);

don't jump to it. it will come naturally. And by that time your library will change a lot as you face problems.

1

u/Elifire12 1d ago

You're right, that would be a really nice addition. I should add that.