View Single Post
Old 08-31-2015, 07:59 PM   #6
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)

Speaking broadly, a data type is the thing that describes the data.

For example:

int x = 5;

Here, the variable x holds the value 5. The data type is int -- or more generally, an integer.

float x = 5.0;

Same idea. x is a float datatype.

vector<int> x(10);

Now we've declared a vector of 10 ints -- as you can guess, the data type is vector<int>.

The underlying datatype of GUI_BUFFER is just CHAR_INFO (although I guess the answer to this may depend on how "deep" they want you to go with the answer -- for example CHAR_INFO[MAP_HEIGHT][MAP_WIDTH] to show that you're aliasing a multi-dimensional data type, etc)

As for typedef vs. using, they are the same thing -- they're just phrased a little differently.

For instance:

typedef long long ll;

allows the coder to use the shorthand "ll" to refer to the "long long" datatype.

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