cout << ++abc;
would display 6, and
cout << abc++;
would display 5
in both cases, though, the value of abc would be 6 after this line is executed.
- Dave
cout << ++abc;
would display 6, and
cout << abc++;
would display 5
in both cases, though, the value of abc would be 6 after this line is executed.
- Dave
For instance, if you are in a for loop, break takes you to the line of code just after the for loop ends.
In VB, Exit For would be the equivalent of break when used in a For loop. There's also Exit Do.
Hope that's clear...
As far as the array goes (the bracketed variable), this code is simply creating an array and initializing the values in the array. Not sure how you initialize arrays in VB other than doing it by hand.
The big thing to remember on arrays is that C/C++ arrays ALWAYS start at 0. In VB, they start at 1 by default unless you specify Option Base 0.
char terrain_texture[] =
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,0,11,0,0,11,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,
0,0,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,0,0,0,1,0,
0,0,1,0,0,0,0,1,0,0,11,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1,0,
0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1,0,
0,0,1,11,0,0,0,1,0,0,0,0,0,0,11,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,1,0,
0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,1,0,
0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0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,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,
0,0,0,1,0,0,0,1,0,0,0,0,11,0,11,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,
0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,1,0,0,0,
};
I just checked - if you declare it as size 0, then by default (at least in VB5) you can access x(0), so a size 1 array actually has 2 entries.
Dim x(size)
actually means
Dim x(ubound)
As for batch filling, I don't think there is a way... QBASIC used to have the DATA statement I think, but once I got VB I just stored all my data in a file and read it as a chunk or used a For loop. The only other thing I can tell you is the VB equivalent of char is Byte I believe.
------------------
Lack