Roommate can't figure out whats wrong

And neither can my dumb ass. He gets an unhanded exception at a hexadecimal memory address. I think it's in the math but I don't code I just come here for chink shit. What's wrong Jow Forums?

Attached: Roommates Decoder Project.jpg (4160x3120, 3.97M)

fake and ghay. nobody is this stupid.

Epic troll post guys

bait nice try

Based retard

Explain; Carlos
Cause I actually don't code
And I actually don't know whats wrong

Lmao why are you posting your roommates first year code
C++ is not for entry level students.

array out of bounds, you cum gargling whore.

install gentoo

He doesn't know I posted it; He was pissed as fuck cause he torrented these tutorial videos and the guy gives him these tests. He was supposed to "Expound upon what he learned" and he's pissed that when he types papa it doesn't output zeros.
Now he's taking a shit and I'm getting called a cum gargling whore
Here's your (you)

>I just come here for chink shit
The state of this fucking board.

you need to terminate an if-else condition chain with a final 'else' or default condition, it is this way in C too.

Tell your friend to get a book and stop being a faggot, problem will fix itself .

also why didnt you just post the fucking source code as plain text using code tags you nig nog?

This might shock you; but I'm a fucking moron

Man, this is so dumb.
If you don't see the mistake right away, then C++ is not for you.

you need to increment num after the if statement. the condition checks if num != length but afterwards you increment num and so it will get the value of length and go out of bounce.

Pre increment num at the end,
not at the beginning

I sent him all these; he can probably figure it out from there, thank you Anons; I'll sage let my shitty thread die now.

why did he write "if else" and not "else if"?
why p is declared with braces and not an equal sign?
why is num incremented at the start of a loop and not at the end?
the error message probably was because of p at the forloop
everyone has their first error messages, i trust this wasn't bait

See, that's why all programmers use Linux. Your roommate just found a windows bug, it's impossible to compile his code on that environment.
Just tried on my Linux box, worked perfectly

>p = 'X'
gee...