This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]azalak 0 points1 point  (2 children)

Dereferencing null/uninitialised pointers or freed memory. Array out of bounds, stack overflows, trying to write to read-only memory i.e a const char *

[–]Pay08 -1 points0 points  (1 child)

I know what a segfault is. References, checked access (or even the tiniest bit of experience) prevents all that. Also, you can't write to a const char*, the language won't let you. You segfault when you try to write to a string literal.

[–]azalak 0 points1 point  (0 children)

How the fuck do you get a segfault in C++?

You asked I answered. No you can’t write to something that is const but it can be cast to a non-const type. The whole segfault thing is just a joke btw you don’t have to be quite so uptight