Правильно ли этот код? Он работает так, как ожидалось, но правильно ли этот код использует указатели и точечную нотацию для структуры?
struct someStruct {
unsigned int total;
};
int test(struct someStruct* state) {
state->total = 4;
}
int main () {
struct someStruct s;
s.total = 5;
test(&s);
printf("\ns.total = %d\n", s.total);
}