C# Console Application - Odd behaviour - char '\a'

Posted by KHT on Stack Overflow See other posts from Stack Overflow or by KHT
Published on 2010-12-24T17:32:29Z Indexed on 2010/12/24 17:54 UTC
Read the original article Hit count: 162

Filed under:
|

After extensive debugging of an application, I noticed the console window would hang when searching text for the char '\a'. The goal is to strip out characters from a file.

The console window would always hang upon exiting the program, and it would make it to the last statement of main. I removed the '\a' from the switch statement and the console application does not hang anymore. Any idea why? I still need to strip out the char '\a', but cannot get the application to work without hanging.

switch (c)
{
    case '\t': //Horizontal Tab
    case '\v': //Vertical Tab
    case '\n': //Newline
    case '\f': //Form feed
    case '\r': //carriage return
    case '\b': //Backspace
    case '\x7f': //delete character
    case '\x99': //TM Trademark
    case '\a': //Bell Alert  **REMOVED THIS** 
        return true;    
}

© Stack Overflow or respective owner

Related posts about c#

Related posts about special-characters