Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
11.3 - char * to uint8_t *
#6
Thanks for the response. To summarise, I think the following is correct:

Code:
extern void print1(const char *text);
extern void print2(const uint8_t *text);

int main(void)
{
    const char *txt = "Some text";
    
    print1("Some text");                // Compliant (preferred solution)
    print2((uint8_t *)"Some text");     // Compliant
    print2((uint8_t *)txt);             // Compliant
}
<t></t>
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)