Guest User

Untitled

a guest
Feb 15th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. extern char buffer1[ 12 ];
  2. extern char buffer2[ 12 ];
  3. void f1 ( void )
  4. {
  5. ( void ) strcpy ( buffer1, "abc" );
  6. ( void ) strcpy ( buffer2, "abc" );
  7. /* The following use of memcmp is non-compliant */
  8. if ( memcmp ( buffer1, buffer2, sizeof ( buffer1 ) ) != 0 )
  9. {
  10. /*
  11. * The strings stored in buffer1 and buffer 2 are reported to be
  12. * different, but this may actually be due to differences in the
  13. * uninitialised characters stored after the null terminators.
  14. */
  15. }
  16. }
Add Comment
Please, Sign In to add comment