This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Aug 25th, 2011  |  syntax: None  |  size: 0.30 KB  |  views: 37  |  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 <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. void foo(char * p, int j) {
  5.        
  6.         int i = 0;
  7.         while (i++ < 1024)
  8.                 p[i] = p[i] + i*2;
  9.        
  10.         if (j > 0)
  11.                 foo(p, j-1);
  12.  
  13. }
  14.  
  15. int main() {
  16.        
  17.         char * p = malloc(10000);
  18.        
  19.         int i = 0;
  20.         while (i++ < 1024)
  21.                 p[i] = p[i] + i;
  22.  
  23.         foo(p, 10);
  24.  
  25.         return 0;
  26. }
clone this paste RAW Paste Data