Wednesday, August 04, 2010

dump_buffer

void dump_buffer(void *buffer, int buffer_size)
{
int i;

for(i = 0;i < buffer_size;++i)
printf("%c", ((char *)buffer)[i]);
}

參考來源:

"void dump_buffer(void *buffer, int buffer_size) { int i; for(i = 0;i < buffer_size;++i) printf("%c", ((char *)buffer)[i]); }"
- C, howto read binary file into buffer (在「Google 網頁註解」中檢視)

No comments: