Mainly simple stuff I've made. I would like some criticism to make my programming methods better. I would like some suggestions and comments on how I coded them.
I don't need to test it. I'm telling you there's a buffer overflow.
pie is declared as an array of size 20. I.e. it contains elements [0..19]. On line 10 you're assigning to element 20, which is 1 element past the end.
Just because it works, it doesn't mean it's correct.
I don't know why It does that for you, it works perfectly fine here.
This is exactly why these kinds of bugs are so dangerous. The program may appear to work fine for months until it turns into a huge project, then all of the sudden the bug rears its ugly head and kicks your program's ass and is next to impossible to find.