Use std::stringstream.

char *inputdata = GetCharBufData();

std::stringstream s;
s << inputdata;

int i;
s >> i;