about data type in pic c compiler????????

Status
Not open for further replies.

osha

Member level 2
Joined
Nov 20, 2005
Messages
42
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Location
egypt
Activity points
1,623
iused pic 16f877a

iwant to know how i can define constant array in pic c compiler?

and are byte=unsigend char?
 

const rom int pwm_ref[6]= {0,8,17,25,33,42};
rom : it says the compiler that the array allocated in program memory, not data memory. if you omit "rom", the variable allocated in data mem.
int: each number in array has 16-bit wide. use "int" even the number is 8-bit. Because it generates more compact code after compile.

No, char is a byte. But signed byte.

char --> 8-bit signed variable. (range : -128,-127)
unsigned char --> 8-bit unsigned variable (0,255)
int --> 16-bit signed (-32768, -32767)
unsigned int --> 16-bit unsigned (0,65536)
long --> 32-bit signed
unsigned long --> 32-bit unsigned
double --> 64-bit signed
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…