This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Complement of Char

Is any direct function is available for the complement of the char variable

Parents Reply Children
  • Barry - he wants a function, so make that:

    char GetComplementOfAChar( char c_in )
    {
       char c_out;
    
       const char ComplementOfAChar[256] = { 0xff, 0xfe, 0xfd, 0xfc,
                                             ...., 0x02, 0x01, 0x00 };
    
       c_out = ComplementOfAChar[ c_in ];
    
       return c_out;
    }
    

    Note
    This message was edited to reduce width.