memory - c - cheak readable bytes -
need little form guys
i wanna cheak if byte readable or not, have search sulution not find
hope me
i have code need if tag cheak if byte readable
#include <windows.h> #include <iostream> #include <cstdlib> #include <stdio.h> void main() { float ramsize; char *ch; unsigned int j=128,readbyte; long i; memorystatusex statex; statex.dwlength = sizeof (statex); globalmemorystatusex (&statex); ramsize = statex.ulltotalphys; for(i=0;i<ramsize;i = i+1) { ch = (char*) i; readbyte = *ch; // if readbyte readable printf("you have readable byte in address: %x , contain in binary:",&readbyte); for(i=0;i<8;i++) { if(readbyte&j) printf("1"); else printf("0"); j=j>>1; } putchar('\n'); // if readbyte not readable printf("sorry: cant read byte: %x",&readbyte); } }
if byte not readable os send signal process. need catch signal or program terminate.
read on signals in course textbook.
Comments
Post a Comment