PRINTING STRINGS

PUTS

#multiple method of displaying strings

char protagonist[10];
protagonist = "Gandalf";

char *hero = "Dumbledore";
hero = "Sirius";

#different ways of displaying/printing strings
puts(protagonist);                   //displaying character array contents to make strings
puts(hero);                          //displaying strings from a pointer char *
puts("Boromir");                     //displaying via immediate values
printf("%s and %s are the best\n", protagonist, hero);

Last updated