I have two arrays defined as char a[4], b[4]....neither will (or should not) contain a null character.
Can someone tell me is it better to use memcmp or strncmp when comparing the two? or for that matter do both work?
Thanks
I have two arrays defined as char a[4], b[4]....neither will (or should not) contain a null character.
Can someone tell me is it better to use memcmp or strncmp when comparing the two? or for that matter do both work?
Thanks
Use memcmp() for possible non Nul ('\0') terminated arrays. Use strcmp() for Nul terminated "Strings"
Perfect