Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What third-party options are there for working with strings in C?

I've been aware for awhile that I code about 17x faster in Python than in C, and I guess I sort of assumed I wasn't much of a programmer until I really thought about it and realized that the only problem is that I can't handle C strings/char arrays/char pointers/whatever. I have a block about them, and manipulating them takes me hours. I do not have this problem in C++.

But life forces me to code in pure C at the moment, and I'm trying to find if there's some third-party library I can add that will make my life easier. I did some googling and I didn't really find much. I'm starting to consider making it myself, but I feel like I'd be reinventing the wheel. Surely there's something out there? Does anyone know of something like that? Something that makes C a little more like C++ in that respect. I realize that's a silly idea, since that's the point of C++, but you understand, I'm sure.

like image 664
temporary_user_name Avatar asked Dec 06 '25 04:12

temporary_user_name


1 Answers

There is the Better String Library, which is a pure C library for working with "strings" which tries to avoid many of the issues with standard C string handling.

like image 108
Reed Copsey Avatar answered Dec 08 '25 17:12

Reed Copsey