| ??? 05/07/02 17:00 Read: times |
#22664 - More details on memory errors |
Again, I inserted the sprintf() code into the example serial project that comes with the compiler. This is my code:
unsigned long num1 = 500; char numstr1[5]; sprintf(numstr1, "Num 1 is %lu", num1); se_print( numstr1 ); where the se_print() function expects a variable of type (const rom char *). This returns an error of "argument #2: memory spaces do not match", referring to the use of sprintf(). I looked again at the prototype for sprintf() and noticed that it expects a (const char *), so I declared const char *lu_str = "%lu"; and replaced the second argument of sprintf() with lu_str. Now the error I get is "operands of '=' are not pointing to the same memory space" in reference to the declaration of lu_str. Any ideas? |



