siongboon
Advanced Member level 1

Hi everyone,
I have the following problem doing string assignment with C18 microchip compiler.
For example, I am able to assign this way
const rom unsigned char testing[]={"GMxxx"};
what appear in memory is G,M,x,x,x
When I do it in another way, the data in memory becomes
const rom unsigned char testing[]={"GMxxx",0x00};
what appear in memory is 0x0E, ...
I hope if someone can explain to me what's going on???
I hope to append 0x0D 0x0A to the end of the string...
Is there any way I can do it in C18 compiler.
I am thinking of doing the following but the data retrieved is not what I want.
const rom unsigned char testing[]={"GMxxx",0x0D,0x0A};
Any alternative?
Thank you so much.
Siong Boon
I have the following problem doing string assignment with C18 microchip compiler.
For example, I am able to assign this way
const rom unsigned char testing[]={"GMxxx"};
what appear in memory is G,M,x,x,x
When I do it in another way, the data in memory becomes
const rom unsigned char testing[]={"GMxxx",0x00};
what appear in memory is 0x0E, ...
I hope if someone can explain to me what's going on???
I hope to append 0x0D 0x0A to the end of the string...
Is there any way I can do it in C18 compiler.
I am thinking of doing the following but the data retrieved is not what I want.
const rom unsigned char testing[]={"GMxxx",0x0D,0x0A};
Any alternative?
Thank you so much.
Siong Boon