These functions make Reddit programmers shit their pants. They’re not “safe” enough lmao

These functions make Reddit programmers shit their pants. They’re not “safe” enough lmao

Attached: 95A048D9-5EF3-4467-88A3-CD572885445D.jpg (1280x720, 81.56K)

Other urls found in this thread:

stackoverflow.com/a/7546745
twitter.com/SFWRedditGifs

Whenever i use calloc it gives me index out of bounds, so i switch to malloc and use a for loop to initialize, and everything works

>another "i just lost an argument with a Rust user and need to cope hard" thread

Attached: cring cnile.png (627x722, 113.67K)

OP its not about being safe, its about a large project having a memory issue due to human error which is going to only be evident on runtime it doesnt matter if you have 10 million hours with C/C++ people make mistakes.

It's been good enough for the most important operating systems / software for half a century - just admit you're a shit programmer.

I am assuming its just poor bait at this point but i will still answer you. There have a been a plethora of vulnerability exploits in Windows over the years due to human errors.

int main() {
int* nigger = malloc(-1);
return;
}

>projecting

(((((((((human))))))))) error

You mean the operating systems with hundreds of CVEs?

Why is there no "recalloc"? Why does C++ has no calloc? This shit pisses me off.

c++ has vector, why would it need calloc?

Why is it always the same illiterate village idiot rescuing these crap threads from page 11?

Attached: 1544123532806.png (680x590, 167.39K)

boo hoo

>Why is there no "recalloc"?
There'd be little point to it. Particularly considering realloc copies over the bytes from the previous allocation.
>Why does C++ has no calloc?
You can force operator new to call the default constructor on integers if need be.
stackoverflow.com/a/7546745

necroniggers are part of the chaos in the machine

noo not free()

Java virtual machine allocates mem and garbage collects it for me. Seethe more tinkertranny.

Leftist programming paradigm is to restrict your freedom.

how do you use calloc? also dont use a for loop for initializing to 0, use memset

why not just call the c functions? also of you want "new" to 0 init your allocated memory, add brackets at the end like so "new type[amount]{}". now it will be 0 init