![]() |
![]() |
![]() |
|
![]() Administrator ![]() ![]() ![]() ![]() ![]() Joined Aug 23, '02 From Seattle, WA Currently Offline Reputation: 14 (100%) ![]() |
I've been writing a program for class and was getting strange errors,
so I went through everything and eventually simplified it down to this super-simple program: CODE #include <iostream> using std::cout; using std::cin; int main() { int buckets[9][4] = {0}; for (int j = 0; j <= 9; j++) { for (int k = 0; k <= 4; k++) { cout << buckets[j][k] << " "; } cout << "\n"; } char ch; cin >> ch; } Sounds simple, right? Create a 10 row, 5 column 2-dimensional array filled with zeroes, right? The problem is that my output is this: Anyone have any idea as to what could be going on? If I manually fill the array with zeroes using two for loops, I get the correct output, but when the program tries to exit after I enter a character, I get this error: Any of you programmers out there have any ideas?
Attached image(s)
![]() ![]() -------------------- New Toyota project coming soon...
|
![]() |
![]() |
|
![]() Enthusiast ![]() Joined Jul 19, '06 From Colorado Currently Offline Reputation: 0 (0%) ![]() |
< Pulls out hair <_<
I prefer Delphi as it is so much easier, but when I get into code I can read it like a book. But I just hate it. I was kicked out of class in school when I coded a checksum error and check that would lock and consume all the resources on a PC in a couple seconds. This was in the late 90's though. I was gonna make a script to run it on boot, and to distribute it to the 9X registry through allowed shares. The teacher didn't think that it was funny. And thus ended my schooling in C++. |
![]() |
|
Enthusiast ![]() ![]() ![]() ![]() Joined Dec 9, '05 From Long Beach Currently Offline Reputation: 1 (100%) ![]() |
QUOTE(Steevo @ Oct 12, 2006 - 9:33 PM) [snapback]491046[/snapback] < Pulls out hair <_< I prefer Delphi as it is so much easier, but when I get into code I can read it like a book. But I just hate it. I was kicked out of class in school when I coded a checksum error and check that would lock and consume all the resources on a PC in a couple seconds. This was in the late 90's though. I was gonna make a script to run it on boot, and to distribute it to the 9X registry through allowed shares. The teacher didn't think that it was funny. And thus ended my schooling in C++. lmao yup hackers are always kids lmao! i remember my computer teacher, he had a program that didnt let us get internet til he enabled it, lol i wrote a visualbasic code and i got internet and everyone else wass like oh damn how u do that lmao i dun think it wass visual basic. ohhh now that i thnk of it it was more of a .bat file. -------------------- Is this good enuff 4 ya? :D
![]() |
![]() ![]() |
Lo-Fi Version | Time is now: July 27th, 2025 - 10:13 AM |