/* --------------------------------------------------------------------- ** Figure 13.14: Do not use == with strings. ** Figure 13.15: Two functions for comparing strings. ** --------------------------------------------------------------------- */ #include "tools.h" /* contains definition of type string */ #define N 5 void main( void ) { char w4[6] = "Hello"; string w5 = "Hello"; string w6 = w5; if (w4 == w5) puts( "Yes, ==" ); else puts( "No, not ==" ); if (w5 == w6) puts( "Yes, ==" ); else puts( "No, not ==" ); if (strcmp( w4, w5 ) == 0) puts( "Yes, str=" ); else puts( "No, not str=" ); if (strequal( w4, w5 )) puts( "Yes, str=" ); else puts( "No, not str=" ); }