I have following define in my code
#define PRODUCTNAME "SomeName"
and I want to send it with a function com_reply(unsigned char* msg, uint16_t lenght)
.
Now I get a warning that my argument differs in signedness. I know what the problem is and also why com_reply
uses unsigned char*
instead of char*
, I just want to know:
How can I define my string as an unsigned char*
so I can use it throughout my program without getting warnings all over the place.
EDIT:
Strictly speaking I have more than one defines here and the main reason is that there is a BANNER
define which consists of several other defines, like this:
#define PRODUCTNAME "SomeName"
#define PRODUCTDATE "2013-03-30"
#define BANNER PRODUCTNAME " (" PRODUCTDATE ")"
Should I create const variables and concatenate them at program start instead of using defines here?
1997 was an awkward year for LeAnn Rimes and Trisha Yearwood. If you don't recall, they were pitted against each other when songwriter Diane Warren commissioned both of them to sing the iconic track “How Do I Live” for the film Con Air.
It all began when Hollywood executives were putting the final touches on the 1997 Nicholas Cage film Con Air. "How Do I Live" written by Diane Warren was going to be included and they needed to find a singer. After some initial deliberation, they decided not to include the LeAnn Rimes version of the song in the film.
This should work:
#define PRODUCTNAME ((const unsigned char *)"SomeName")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With