View Single Post
Old 08-31-2015, 09:01 PM   #8
Reincarnate
x'); DROP TABLE FFR;--
Retired StaffFFR Veteran
 
Reincarnate's Avatar
 
Join Date: Nov 2010
Posts: 6,332
Default Re: [University - C++ Programming] Help With Assignment (Very Basic Stuff)

Quote:
Originally Posted by sickufully View Post
Hmm yeah that mostly seems to make sense to me. If the underlying multi-dimensional data type is CHAR_INFO[MAP_HEIGHT][MAP_WIDTH], does that mean the data type GUI_BUFFER is int int?

I can only assume the teacher wants a basic description of the underlying data type as this is only the first assignment and we haven't covered much of what's being asked on the assignment, hence why I'm finding this so difficult.
The size parameters are integers (specifically, constant unsigned ints), but that doesn't necessarily mean that the underlying datatype is. For example you could have a two-dimensional array of strings, ints, floats, etc.

If you want more detail on that piece:


In this case, note that "rScreenBuffer" is declared in your code, of type GUI_BUFFER (and therefore of type CHAR_INFO), and we see how it gets used elsewhere:

rScreenBuffer[row][col].Char.AsciiChar = (char)TOKEN[rTile];

rScreenBuffer[row][col].Attributes = 0;

So the CHAR_INFO multidimensional array doesn't contain ints -- it contain some sort of object that has "Char" and "Attributes" members. So it's probably a multidimensional array of structs, but I imagine this is more than what your teacher is asking for so I put this in spoiler tags.


In this case, I would say the data type is "CHAR_INFO[][]" to show that it's a two-dimensional datatype being used.

Last edited by Reincarnate; 08-31-2015 at 09:04 PM..
Reincarnate is offline   Reply With Quote