Advertisement
ijontichy

heh2.c

Mar 26th, 2014
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.54 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     char dicks[] = "hello, world\0";
  7.     char* heh = NULL;
  8.     int s = 0, i = 0;
  9.  
  10.     printf("%s\n", dicks);
  11.  
  12.     while (1)
  13.     {
  14.         unsigned char next = fgetc(stdin);
  15.         s += 1;
  16.        
  17.         if (heh == NULL) { heh = malloc(s * sizeof(char)); }
  18.         else { heh = realloc(heh, s * sizeof(char)); }
  19.  
  20.         heh[s-1] = next;
  21.  
  22.         if (next == 10)
  23.         {
  24.             heh[s-1] = '\0';
  25.             break;
  26.         }
  27.     }
  28.  
  29.     printf("\"%s\"? wow you're a cunt", heh);
  30.  
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement