@vaporeon_ @aescling there's almost always some sort of standard library container class for anything you'd use malloc for. I'd much sooner default to std::string in your situation

If the container doesn't exist then you can use the new keyword. I don't know of a situation you would use malloc other than to interface with C libraries or legacy C++ code

@vaporeon_ it was a very deliberate design choice when C++ was made in the 80s to not allow implicit void* conversions. It's one of the few very deliberate situations C++ fails to be a superset of C. You have to explicitly cast a void pointer to the exact type you want it to be

You can disagree with this choice but it was a choice made from basically the very beginning

@vaporeon_ you can use a C-style cast to convert a pointer to a char to a pointer to a 16-bit integer, which will almost certainly cause a runtime error

static cast won't let you do something like that

@vaporeon_ to oversimplify a bit it's like a c-style cast that has a lot more restrictions,and is checked by the compiler, to protect the programmer from making silly mistakes

@aescling @vaporeon_ I know enum basics but I don't understand the gorp = after the enum declaration

I am actually not a C++ master at all. I just know what rvalues are

@vaporeon_ I gotta be real with you vappy, I have no idea what is going on here with the enum lol

jimmy neutron is actually composed of three jimmy quarks, held together by a james bond

"ive never thought of jesus christ as a sex object"

Show older
📟🐱 GlitchCat

A small, community‐oriented Mastodon‐compatible Fediverse (GlitchSoc) instance managed as a joint venture between the cat and KIBI families.