vinodstanur
Advanced Member level 3
- Joined
- Oct 31, 2009
- Messages
- 751
- Helped
- 114
- Reputation
- 234
- Reaction score
- 114
- Trophy points
- 1,333
- Location
- Kerala (INDIA)
- Activity points
- 7,054
I am new to avr-gcc.
I am just trying an lcd program for atmega16.
Now,
data('H'); data('E'); data('L'); data('L'); data('O');
The above code is working fine!!!
But...
below code is not
const char *p = "HELLO";
while(*p) data(*p++);
below code is also not working,
char *p = "HELLO";
while(*p) data(*p++);
But the below code is WORKING!!
const char *p = "HELLO";
data(*p++);
data(*p++);
data(*p++);
data(*p++);
data(*p++);
!!!!!
Why ???????
I am just trying an lcd program for atmega16.
Now,
data('H'); data('E'); data('L'); data('L'); data('O');
The above code is working fine!!!
But...
below code is not
const char *p = "HELLO";
while(*p) data(*p++);
below code is also not working,
char *p = "HELLO";
while(*p) data(*p++);
But the below code is WORKING!!
const char *p = "HELLO";
data(*p++);
data(*p++);
data(*p++);
data(*p++);
data(*p++);
!!!!!
Why ???????
Last edited: