02 - Data Types Flashcards
What value will sizeof(char) always return?
1
What type is missing in this hierarchy?
char <= ??? <= int <= long <= long long
short
How many bytes does the C standard require for the short data type?
> = 2
How many bytes does the C standard require for the intndata type?
> = 2
How many bytes does the C standard require for the long data type?
> = 4
How many bytes does the C standard require for a pointer?
Nothing
The standard does not define the length of a pointer
What is the data type of this constant?
7
Integer (int by default)
What is the data type of this constant?
3.141
Floating point (double by default)
What is the data type of this constant?
-12.4e-24
Floating point (double by default)
What is the data type of this constant?
1000000000ll
long long
What is the data type of this constant?
902ul
unsigned long
What is the data type of this constant?
7.45f
float
What is the data type of this constant?
‘\n’
char
What is the data type of this constant?
“\n”
string (array of char)
What is the data type of this constant?
“Hello, World!\n”
string (array of char)
What is the data type of this constant?
0x10
hexadecimal
What is the data type of this constant?
-0100
octal
What is the data type of this constant?
0xdull
unsigned long long hex
What is the symbol to denote a new line?
\n
What is the symbol to denote a tab?
\t
What does the special character ‘\n’ denote?
A newline
What does the special character ‘"’ denote?
A double quote
What characters can a C variable name start with?
A letter of an underscore
Which C variables are automatically initialised?
Global variables are initialised to 0. All other variables must be manually initialised