Hello,

here is an example.
It sets a struct pointer to an allocated memory area and initializes the struct.

Code:
void init_mystruct(MYSTRUCT* mystruct) {
mystruct.whatever = ...;
}

...

// dynamically allocate memory for a struct and initialize it
MYSTRUCT* mystruct = malloc(sizeof(MYSTRUCT));
init_mystruct(mystruct);