Friday, 16 April 2010

Printing character Array using pointers with puts function

#include<stdio.h>
int main(void)
{
  char* ptr0;

  ptr0="ptr0 points to this string.";
  puts(ptr0);
  ptr0="A shorter string.";
  puts(ptr0);
  ptr0="A new string for ptr0 that is longer than the previous.";
  puts(ptr0);
  return 0;
}

No comments:

Post a Comment