title: how to convert mib to mb i want to test ram
body: <p>I am trying to test how much RAM a 32 bit OS supports. </p>
  
  <p><strong>Hi i am converting app from 32 bit os to 64 bit os Just checking looking will 4gb ram is sufficient this is what i want to check</strong> </p>
  
  <p>what all occupies more memory i know pointers will double please help me below program <strong>such that program works for MB not MIB</strong></p>
  
  <p>I tried this program but I am missing some method for the conversion of MiB to MB.</p>
  
  <p>How can I get below program to work?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  
  int main(int argc,char* argv[]){
          size_t oneHundredMiB=100*1048576;
          size_t maxMemMiB=0;
          void *memPointer = NULL;
          while((memPointer = malloc(maxMemMiB += oneHundredMiB)) != NULL) {
                  printf("Max Tested Memory = %zi\n",maxMemMiB);
                  memset(memPointer,0,maxMemMiB);
                  free(memPointer);
          }
          printf("Max Usable Memory aprox = %zi\n",maxMemMiB-oneHundredMiB);
          return 0;
  }
  </code></pre>