Sorry for the simple question...
How would I pass a hex-value through a function?
I mean, what type would I use?
Currently I have two different functions. One
is used to change the screen resolution to 13h,
and the other is to change it back to 03h. I would
like to only have one function and pass the
screen-mode through that.
Instead of (2 seperate functions):
I would like (1 function):
int ChangeScreenMode(TYPE ScreenMode);
What would TYPE be? Does it matter?
unsigned int is a good bet
Or any other unsigned integer type will do
Any signed integer type will probably do for this specific example, but you might get the odd compiler warning if you try and pass a hex value with the most significant bit set (the function will think its a negative value)
Vid modes never even come close to FFh, so a short int would actually work fine. An integer is just a particular range of numbers. The base those numbers are in is irrelevant as long as the number is w/ in the range.