p_and_s.c 375 B

12345678910111213141516
  1. /* p_and_s.c -- pointers and strings */
  2. #include <stdio.h>
  3. int main(void)
  4. {
  5. const char * mesg = "Don't be a fool!";
  6. const char * copy;
  7. copy = mesg;
  8. printf("%s\n", copy);
  9. printf("mesg = %s; &mesg = %p; value = %p\n",
  10. mesg, &mesg, mesg);
  11. printf("copy = %s; &copy = %p; value = %p\n",
  12. copy, &copy, copy);
  13. return 0;
  14. }