unsigned __int8 result[]= new unsigned __int8[sizeof(username) * 4];
IntelliSense: initialization with '{...}' expected for aggregate object
unsigned __int8 result[]= new unsigned __int8[sizeof(username) * 4];
IntelliSense: initialization with '{...}' expected for aggregate object
The types are not the same; you cannot initialize an array with a pointer.
new unsigned __int8[sizeof(username) * 4];
returns a unsigned __int8*
, not unsigned __int8[]
change your code to
unsigned __int8* result = new unsigned __int8[sizeof(username) * 4];
new returns a pointer, not an array. You should declare
unsigned __int8* result = ....
here, result is an array of __int8, so you can't assign one value into the entire array. You actually want:
unsigned __int8* p_result = new unsigned __int8[sizeof username * 4];