I am trying to program a microchip in C. Right now my I'm working to update a line on an LCD screen but it doesnt work correctly. Can anyone shed some light on this?
float slope = 0.0626;
char *mystring;
int8_t LCDline1[20];
void myfunction(){
sprintf(*mystring, "%ld", (long)(slope * 10000));
memcpy(LCDline1, *mystring, strlen(*mystring)+1);
}
When I run compile code I get the following three errors.
calibrate.c:60:5: warning: passing argument 1 of 'sprintf' makes
pointer from integer without a cast. note: expected 'char *'
but argument is of type 'char'
calibrate.c:61:5: warning: passing argument 1 of 'strlen' makes
pointer from integer without a cast. note: expected 'const char *'
but argument is of type 'char'
calibrate.c:61:5: warning: passing argument 2 of 'memcpy' makes
pointer from integer without a cast. note: expected 'const void *' but
argument is of type 'char'
I am not sure what I am doing wrong, I am using the following definitions for my starting point
void *memcpy(void *str1, const void *str2, size_t n)
size_t strlen(const char *str)
char *p = "String";