Guest User

Untitled

a guest
May 4th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.26 KB | None | 0 0
  1. $ gcc blah.c;./a.out
  2. asdfasdf
  3. dfasdf
  4.  
  5. $ cat blah.c
  6. #include <stdlib.h>
  7. #include <stdio.h>
  8. #include <string.h>
  9. int main() {
  10.     char * year = malloc(sizeof(char) * 10);
  11.     fgets(year, 10, stdin);
  12.     year = &year[2];   
  13.     printf("%s\n", year);
  14.     return 0;
  15. }
  16. $
Advertisement
Add Comment
Please, Sign In to add comment