/* --------------------------------------------------------------------- ** Figure 13.9: String literals and string output. ** --------------------------------------------------------------------- */ #include "tools.h" void main( void ) { string s1 = "String demo program."; string s2 = "Print this string and ring the bell.\n"; puts( s1 ); printf( "\t This line prints single ' and double \" quote marks.\n" ); printf( "\t %s\n%c", s2, '\a' ); puts( "These two quoted sections " "form a single string literal.\n" ); printf( "You can break a format string onto several lines if you end \n" "each line with a quote and begin the next line with a quote.\n" "You may indent the lines any way you wish.\n\n" ); puts( "This\tstring\thas\ta\ttab\tcharacter\tafter\teach\tword.\t" ); puts( "Each word on the line above should start at a tab stop. \n" ); puts( "This puts()\n \t will make 3 lines of output,\n \t indented.\n" ); printf( " >>%-35s<< \n >>%35s<< \n", "left justified, -field width", "right justified, +field width" ); printf( " >>%10s<< \n\n", "not enough room? Field gets expanded" ); }