put_out.c 371 B

1234567891011121314151617
  1. /* put_out.c -- using puts() */
  2. #include <stdio.h>
  3. #define DEF "I am a #defined string."
  4. int main(void)
  5. {
  6. char str1[80] = "An array was initialized to me.";
  7. const char * str2 = "A pointer was initialized to me.";
  8. puts("I'm an argument to puts().");
  9. puts(DEF);
  10. puts(str1);
  11. puts(str2);
  12. puts(&str1[5]);
  13. puts(str2+4);
  14. return 0;
  15. }