I'm using sprintf with the IMXRT1021 NXP microcontroller but not getting the required output.
Library: Redlib (nohost-nf)
I have tried both ways but the result is the same.
sprintf(at,"AT=\x22%s\x22,\x22%s\x22\r\n","abcdef","123456");
sprintf(at,"AT=\"%s\",\"%s\"\r\n","abcdef","123456");
Expected output:
AT="abcdef","123456"\r\n
Actual output:
AT=\"abcdef\",\"123456\"\r\n
It depends on what you are talking about.
If you were to output this into a terminal, the string you would see is the one you expected:
AT="abcdef","123456" # plus newline etc.
However, the C representation of that string is:
"AT=\"abcdef\",\"123456\"\r\n"
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