EmbeddedRelated.com

Charles Miller (@Mr68360)

Embedded Firmware Engineer for 30+ years, specializing in bare-metal ARM/Cortex, C++, sensor measurement, and control.

Re: strcmp help please

Reply posted 5 years ago (04/07/2020)
Are you seeing "ER_CMD#a01" + 0, or "ER_CMD#a010"? The latter includes the zero character at the end, not an asciiz (aka NUL, aka terminator, aka '\0')!The terminator...

Re: strcmp help please

Reply posted 5 years ago (04/07/2020)
In C, a string literal has an implied terminator.  char s[] = "abc" has a string length of 3, a memory buffer length of 4, and appears in memory as'a', 'b', 'c',...

Re: strcmp help please

Reply posted 5 years ago (04/07/2020)
Hello, Ridge.Note that strcmp() is string compare, not memory compare.  If either  strings in memory at pTx or pRx do not end in a zero (sometimes called an asciiz...

Use this form to contact Mr68360

Before you can contact a member of the *Related Sites:

  • You must be logged in (register here)
  • You must confirm you email address