Error:, #included from: main.c: function argument #2 of type 'flash unsigned char [11]' is incompatible with required parameter of type 'unsigned char *'
and this is the same for all of string.h lib functions.
in ARM and keil compiler i didn't had this problem but in codevision error occurs.
i know i can use for loop but is there any way to avoid this error?
i droped the unsigned and still have the same error it says that flash char is incompatible with char so the problem is the const type if i put both array unsigned or signed it work but if one of them become const error occurs I'm looking for a way to avoid this
const types may be stored in program memory rather than data memory. If the CPU architecture in question cannot use the same instruction for both areas, const types have to be handled using special instructions.
const types may be stored in program memory rather than data memory. If the CPU architecture in question cannot use the same instruction for both areas, const types have to be handled using special instructions.
Normally in this case, they will have thier own "special" routines.. I would also use a workaround.. Sprintf() is normally in the stdio.h and can handle this.
sprintf( A , "HELLO WORLD!");
Will do the same thing.. Most embedded tools have this tool.
I normally (in C) define two buffers, one to hold the final string and one to build parts in.
I.E.
char buff[128];
char buf[10];
strcpy(buf,"Hello World");
strcat(buff.buf);
itoa(var,buf,10);
strcat(buff,buf);
Mike.
BTW, did codevision really add an n to strcpy to become strncpy?
Normally in this case, they will have thier own "special" routines.. I would also use a workaround.. Sprintf() is normally in the stdio.h and can handle this.
sprintf( A , "HELLO WORLD!");
Will do the same thing.. Most embedded tools have this tool.
Normally in this case, they will have thier own "special" routines.. I would also use a workaround.. Sprintf() is normally in the stdio.h and can handle this.
sprintf( A , "HELLO WORLD!");
Will do the same thing.. Most embedded tools have this tool.
yes removing the const make the error go away but i want to do it with const.
const char stores in flash but char stores in ram i want to optimize my ram usage so i have to use const.
yes removing the const make the error go away but i want to do it with const.
const char stores in flash but char stores in ram i want to optimize my ram usage so i have to use const.