Guest User

Uninitialised memory test

a guest
Nov 6th, 2014
181
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. #define LEN 0xfff
  4. #define DTYPE unsigned int
  5. #define PRI_DTYPE "x"
  6.  
  7. int main()
  8. {
  9.     int i;
  10.     DTYPE buf[LEN], result = 0;
  11.  
  12.     for (i = 0; i < LEN; i++)
  13.     {
  14.         result ^= buf[i];
  15.     }
  16.    
  17.     printf("Result = 0x%"PRI_DTYPE"; length of buffer = %d byte(s) * %d\n", result, sizeof(DTYPE), LEN);
  18.    
  19.     return 0;
  20. }
RAW Paste Data