#include #include #include #include int main() { // allocate a blob of memory char* ptr = (char*)malloc(MEM_SIZE); // actually use the memory otherwise the compiler may optimize the allocation away memset(ptr, 0xff, MEM_SIZE); sprintf(ptr, "%d\n", ptr[MEM_SIZE-1]); while (1) { // sleep so we're not slamming the CPU usleep(100000); } // let's be nice and give the memory back free(ptr); return 0; }