-
Data Type
How can I manipulate a char array as a long integer array, i.e. 4 bytes at a time rather than 1 byte per instruction?
CRYPTOFACILITY_API int _stdcall cbcenc(char * srcfid, char * dstfid, unsigned char * key, unsigned char * mac)
{
register int i;
for (i = 0; i < 8; i++) mac[i] = 0x00;
}
In the above case, how can I initialise mac by assignment of =0x00000000 without changing the type definition of formal arguments?
Thanks.
-
C:
unsigned int *piMac = (unsigned int *)mac;
C++:
unsigned int *piMac = reinterpret_cast<unsigned int *>(mac);