Advertisement
Guest User

Untitled

a guest
Nov 1st, 2014
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.23 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. main()
  4. {
  5.     char* lines[3];
  6.     char line[1024];
  7.     int n = 0;
  8.     while(n < 3 && fgets(line , 1024 , stdin) != NULL){
  9.         lines[n] = strdup(line);
  10.         printf("%d : %s\n",n,lines[n]);
  11.         n++;
  12.     }
  13.  
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement