int width = 19;
int height = 20;
int total_size = width * height *int_size;
int * int_p = (int *)malloc(total_size);
char* char_p = (char *)malloc(total_size);
memset(char_p, 1, total_size);
int_p = (int*)char_p;
直接强转即可。
int width = 19;
int height = 20;
int total_size = width * height *int_size;
int * int_p = (int *)malloc(total_size);
char* char_p = (char *)malloc(total_size);
memset(char_p, 1, total_size);
int_p = (int*)char_p;
直接强转即可。