Dear Forum Members,
I am using CrossStudio for MSP430F1611. My code is having following routine for copying data from one structure to another.
void mem_cpy(void *pp_dest,void *pp_source, unsigned char size)
{
1 #define p_dest ((unsigned char *)pp_dest)
2 #define p_source ((unsigned char *)pp_source)
3
4 while(size)
5 {
6 *p_dest = *p_source;
7 *p_source = p_source++ ;
8 *p_dest = p_dest++ ;
9 size-- ;
10 }
11
12 #undef p_dest
13 #undef p_source
}
The compiler is giving error at line 7 and 8 as lvalue required. Can anyone please clarify the error in code? Is there any limitation for using pointer (void pointer) with CrossStudio?
Thanks in advance.