c - cheak readable bytes

This is a discussion on c - cheak readable bytes within the Windows Programming forums, part of the Platform Specific Boards category; need little help form you guys i just wanna to cheak if the byte is readable or not, i have ...

  1. #1
    Registered User
    Join Date
    Jul 2013
    Posts
    7

    c - cheak readable bytes

    need little help form you guys
    i just wanna to cheak if the byte is readable or not, i have search for sulution but not find
    hope you will help me
    i have this code i need if tag that cheak if byte is readable

    Code:
    #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 is readable
           printf("you have readable byte in address: %x , that 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 is not readable
           printf("Sorry: you cant read this byte: %x",&readbyte);
       }
    }

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,659
    Duplicate c - cheak readable bytes
    Closed.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. c - cheak readable bytes
    By esmaelmmd in forum C Programming
    Replies: 15
    Last Post: 07-24-2013, 02:55 PM
  2. working set, virtual bytes and private bytes
    By George2 in forum C++ Programming
    Replies: 3
    Last Post: 01-10-2008, 01:39 AM
  3. File IO, .ini readable?
    By Zeusbwr in forum C++ Programming
    Replies: 7
    Last Post: 10-13-2004, 12:33 AM
  4. dictionary in readable database
    By jverkoey in forum C++ Programming
    Replies: 4
    Last Post: 03-13-2004, 10:21 PM
  5. readable filemode from st_mode
    By iain in forum Linux Programming
    Replies: 1
    Last Post: 12-04-2002, 05:30 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21