I am having problems with my code to find the answer to Project Euler problem 25. I already found the answer online for troubleshooting, but I still can't get the correct answer. What's wrong with my code?
You set the entire 2d array to zeros, and then make [999][1] and [999][2] equal to 1. Your sequence makes [999][0] = 1, [999] = 1, and [999][2] = 2. However, when it loops it starts dealing with [998], which is all zeros.
Hmm, I guess since you keep looping on those [999], your integer is certainly overflowing at some point.
Your solution (a 2d array of ints) isn't going to work too well. You need an integer with 1000 digits, which is how many bytes, much more than four. char number[1000]; would be enough to store the number you need, you just need to program a way to deal with those char like they were a base ten number.