The array at line 10 pr[] has no errors but the error at line 20 th[] throws an error. it works when i declare tr at the beginning of the code but fails to compile when i want to declare it in the middle of the code.
#include<reg51.h>
unsigned int i,j,dc;
unsigned int pwr[]={0x00,0x01,0x02,0x03,0x04};
unsigned int *ch;
void main(void)
{
j=0;
while(1)
{
unsigned int pr[5]={0x00,0x01,0x02,0x03,0x04};
ch=&pr[2];
i=0;
dc=1000;
IE=0x82;
TMOD=0x01;
TL0=0x18;
TH0=0xfc;
TR0=1;
while(dc!=0);
unsigned int tr[5]={0x00,0x01,0x02,0x03,0x04};
dc=1000;