dashkil
Member level 2
i have some problem in this code;
this one is correct. but having problem as mentioned below:
problems:
1) when i declare char text[] in the void main() it shows error; it shows no error when declare outside the void main as global variable.
2) Again declaring char z within void main or outside shows error; but no error when decelerated within while loop.
i need explanation about this kind of problem.
this one is correct. but having problem as mentioned below:
Code:
char text[]="kkkkk";
void main()
{
ADCON1=0x06;
TRISA=0xFF;
TRISB=0;
PORTA=0;
PORTB=0;
while(1){
char z;
if(PORTA.F0==1)
{
for(z=0;z<5;z++)
PORTB=text[z];
}
else
{
;
}
}
}
problems:
1) when i declare char text[] in the void main() it shows error; it shows no error when declare outside the void main as global variable.
2) Again declaring char z within void main or outside shows error; but no error when decelerated within while loop.
i need explanation about this kind of problem.
Last edited: