7

C:
char greeting[] = "Hello world";

Developers: char array... What da f*CK!

C++
... Okay.

std::string,
std::string_view,
char*,
std::wstring,
hstring,
qstring...
How about now? ( ͡° ͜ʖ ͡°)

Comments
  • 0
    Pretending that strings are something they really aren't is what necessitates string builders. If you really handled them by chaining atomic concat operations it would be unusably slow.
  • 1
    @Haxk20 and what is it equivalent to?
  • 1
    @Haxk20 well you said let's not go into that, but I was asking about it. what is text *=skfj equivalent to if it is not text[]
    my background is not c++
  • 1
    utf8 bytes...

    When I read this post my response was:

    What the fuck just happened?
  • 0
    It’s great as long as you do some basic ascii stuff with strings.
    But you will pull your hair out working with utf8 strings if you treat them as char arrays.
    Strings are fucking complex beasts and it’s incredibly hard to make them both simple to use AND behave correctly.
Add Comment