P
phaedrus
Hi guys,
Clue me up, please.
When we declare variables like
float x;
int y;
char z;
long w;
and so on, are we doing anything more than just reserving a certain
number of bytes for these data types to occupy?
I mean, the compiler doesn't flag up an error if we try to store (for
example) a letter 'a' in an int, does it? Presumably we can store
*any* type of data in *any* variable type provided said declared type
has enough room to accommodate it?
Aren't the names 'float', 'int', 'char' and so forth simply there to
remind the programmer what data type the variable should be? The
compiler is blind to this human distinction, isn't it?
Clue me up, please.
When we declare variables like
float x;
int y;
char z;
long w;
and so on, are we doing anything more than just reserving a certain
number of bytes for these data types to occupy?
I mean, the compiler doesn't flag up an error if we try to store (for
example) a letter 'a' in an int, does it? Presumably we can store
*any* type of data in *any* variable type provided said declared type
has enough room to accommodate it?
Aren't the names 'float', 'int', 'char' and so forth simply there to
remind the programmer what data type the variable should be? The
compiler is blind to this human distinction, isn't it?