D
dspfun
Hi,
Is it recommended to use char instead of int for variables that you
know never will contain a value larger than 255? A small example
follows:
#include <stdio.h>
int main(void)
{
//int i = 1;
char i = 1; //is this better than previous line?
printf("i=%d\n",i);
return 0;
}
What are the pros and cons of using char instead of int when values
will not exceed 255?
Brs,
Markus
Is it recommended to use char instead of int for variables that you
know never will contain a value larger than 255? A small example
follows:
#include <stdio.h>
int main(void)
{
//int i = 1;
char i = 1; //is this better than previous line?
printf("i=%d\n",i);
return 0;
}
What are the pros and cons of using char instead of int when values
will not exceed 255?
Brs,
Markus