Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Dec 11th, 2012  |  syntax: None  |  size: 0.26 KB  |  views: 22  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3.  
  4. int main()
  5. {
  6.         static char *buf,*p;
  7.        
  8.         p = (char*)malloc(20*sizeof(char));
  9.        
  10.         buf = p;
  11.  
  12.         scanf("%s",buf);
  13.  
  14.         while(buf[0] != '\0')
  15.                 printf("\n%s\n",buf++);
  16.        
  17.         free(p);
  18.         buf=NULL;
  19.  
  20.         system("pause");
  21.         return 0;
  22. }