Hi. I have one silly problem. I'm trying to read from file with ReadFile.read(ReadBuff, 1); char by char and i need to convert them to ascii code. With normal ascii symbols it's all right. But them i'm trying to convert extended ascii symobl to ascii code it gives me negative value. I'm using int ascii = int(ReadBuff); Any ideas?

char m_ReadBuff;
char *p_ReadBuff = &m_ReadBuff;
ReadFile.read(p_ReadBuff, 1);
m_SymbolInt = int(m_ReadBuff);

Unsigned int isn't working too.

Yeah I would try

unsigned char m_ReadBuff;
unsigned char *p_ReadBuff = &m_ReadBuff;

Edited 6 Years Ago by gerard4143: n/a

std::basic_istream<_Elem,_Traits>::read' : cannot convert parameter 1 from 'unsigned char *' to 'char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Not working too

Edited 6 Years Ago by lukename: n/a

This question has already been answered. Start a new discussion instead.