1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
unsigned char cmd_0[]={
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
};
int main(void)
{
unsigned char *ask;
// allocate a block of memory for 1 element, which is 256 bytes
ask = (unsigned char*)calloc(1,256);
memcpy(ask, cmd_0, sizeof(cmd_0));
printf("first element is %u\n", *ask);
return 0;
}
|