title: Prevent user from pressing backspace
body: <p>I'm developing a program that uses <code>malloc</code> and <code>realloc</code> functions to increment the pointer buffer in real-time while the user is typing a string.</p>
  
  <p>The problem is, that I'd like to prevent the user from hitting <kbd>Backspace</kbd> to correct the input.
  Is it possible to block <kbd>Blackspace</kbd> key somehow in C while using <code>getche()</code>?</p>
  
  <p>My final program will have two inputs: one without <kbd>Backspace</kbd> (you can't go back), and another with <kbd>Backspace</kbd>. (you can correct the input and then press Enter).</p>
  
  <pre><code>char *szString;
  char *tmp;
  int i = 0;
  char c;
  
  szString = '\0';
  szString = malloc(1);
  
  printf("Enter a string: ");
  
  while ((c = getche()) != '\r')
  {
      if(c = 0x08) // BackSpace
      {
          //
      }
      szString[i] = c;
      i++;
      tmp = realloc(szString, i+1);
      szString = tmp;
  }
  
  szString[i] = '\0';
  
  printf("\nYou typed: %s", szString);
  </code></pre>