I've the following struct:
typedef struct{
int freq;
char val;
} Char; // alias
And I need to create a buffer (pointer) to a certain number of Char
as follows:
Char* chars = calloc(256, sizeof(Char));
And I would like to initialize freq
to -1
for all Char
structs in chars
. Is it possible to do it without a loop?