I have these defined in the interface of an ObjC class:
unsigned m_howMany;
unsigned char * m_howManyEach;
...
Then later in the code I have this:
m_howManyEach = malloc(sizeof(unsigned) * m_howMany);
which is where I get a warning "Result of malloc is converted to a pointer of type unsigned char, which is incompatible with sizeof operand type unsigned int"
Could someone please explain the proper use of malloc()
in this situation, and how to go about getting rid of the warning?