Coding C: initialize structs in definition

Hi,

Task

We have a included struct called counter and we don’t want to assign the initial values in the main function.

Solution

source.c

#include <counters.h>

struct counter_t counter = {
    .max_value = 1234,
};

int main(void)
{
    return(0);
}

Bye, Sven