title: Displaying char/number from hex
body: <p>Basically, I need my program to display something like this: <a href="http://i.imgur.com/ZOfnEJm.png" rel="nofollow">http://i.imgur.com/ZOfnEJm.png</a></p>
  
  <p>I feel like for the most part, I have the code down. However, I'm having trouble displaying anything between the <code>||</code> portion of my code. When I compile, nothing appears in between. The 'format' is supposed to be like this:<br>
  <code>the memory address is on the far left, followed by two groups of eight-byte sequences (each byte is represented with a two-digit hex value), followed by the ASCII representation of the hex bytes placed between the vertical bars on the far right</code>. If the hex code isn't an ASCII character, I'm to display a period (.).   </p>
  
  <p>On to the code, then:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;ctype.h&gt;
  
  void DumpMem(void *arrayPtr, int numBytes);
  
  int main()
  {
      auto int numBytes;
      auto double *doublePtr;
      auto char *charPtr;
      auto int *intPtr;
  
      // Doubles
      printf("How many doubles? ");
      scanf("%d", &amp;numBytes);
      doublePtr = malloc(numBytes * sizeof(doublePtr));
  
      if (NULL == doublePtr)
      {
          printf("Malloc failed!");
      }
  
      printf("Here's a dynamic array of doubles... \n");
      DumpMem(doublePtr, numBytes);
      free(doublePtr);
  
      // Chars
      printf("\nHow many chars? \n");
      scanf("%d", &amp;numBytes);
      charPtr = malloc(numBytes * sizeof(charPtr));
  
      if (NULL == charPtr)
      {
          printf("Malloc failed!");
      }
  
      printf("Here's a dynamic array of chars... \n");
      DumpMem(charPtr, numBytes);
      free(charPtr);
  
      // Ints
      printf("\nHow many ints? \n");
      scanf("%d", &amp;numBytes);
      intPtr = malloc(numBytes * sizeof(intPtr));
  
      if (NULL == intPtr)
      {
          printf("Malloc failed!");
      }
  
      printf("Here's a dynamic array of ints... \n");
      DumpMem(intPtr, numBytes);
      free(intPtr);
  }
  
  void DumpMem(void *arrayPtr, int numBytes)
  {
      auto unsigned char *startPtr = arrayPtr;
      auto unsigned char *ptrOne = startPtr;
      auto unsigned char *endPtr = arrayPtr + numBytes;
      auto int counter = 0;
  
      printf("%p  ", &amp;startPtr);
  
      for (; startPtr &lt; endPtr; startPtr++)
      {
          printf("%02x ", *startPtr);
          counter++;
  
          if (counter == 16)
          {
              printf("|");
              for(; ptrOne &lt; 16; ptrOne++)
              {
                  if (isalpha(*ptrOne))
                  {
                      printf("%c", *ptrOne);
                  }
                  else if (isdigit(*ptrOne))
                  {
                      printf("%d", *ptrOne);
                  }
                  else if (ispunct(*ptrOne))
                  {
                      printf("%c", *ptrOne);
                  }
                  else
                  {
                      printf(".");
                  }
              }
              printf("|");
  
              printf("\n");
              printf("%p  ", &amp;startPtr);
              counter = 0;
          }
      }
  
  }  
  </code></pre>
  
  <p>So, thoughts? Help, please!</p>