|
-
Feb 14th, 2003, 11:29 PM
#1
Thread Starter
Lively Member
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.
-
Feb 15th, 2003, 05:10 AM
#2
C:
unsigned int *piMac = (unsigned int *)mac;
C++:
unsigned int *piMac = reinterpret_cast<unsigned int *>(mac);
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|