The error is on the line of the for statement. You can’t create a 0x0 dataset because that would mean you have no data. The point is the size of the dataset is not part of the for statement. So you need to use the explicit statement of “for(int i = 0; i < x.length; i++)”.
The problem is the for statement is not defined in the file. I didn’t know about that so I didn’t try to create a file that does that.
I just recently got into the habit of using the for statement. I always thought it was a bit dirty to do that, but it actually makes my life so much easier.
I have my own little pet peeve of mine. In my current job I have to write an entire program and debug it in the debugger. I thought that was a good thing, but often times when I run my code in the debugger I am finding that I didn’t even use the debugger properly. I can go through a function, or use a variable I’ve never used before and never will use again, and I am able to figure out what that variable is.
That’s a good thing, right? The debugger lets us step into that function and see what variables are being used. But, when I try to use the debugger in my code, I find that I can’t even figure out what variable I used.
The compiler has a bunch of settings that allow it to generate code that is more than just a series of statements. In particular, it can generate code that is compiled to a “structure with a pointer to an array” type of thing. This is a lot more efficient than just a series of statements. And it’s also better than just a series of statements at generating code that just returns the answer.
The biggest thing I can’t figure out is how to actually use the debugger, although it looks like the debugger is pretty good.
The thing that I can’t figure out, is how you would go about getting this code to actually work.