What is the problem with this code :
struct Counter { int count; }; void increment(Counter c) { c.count += 1; } int main() { Counter clock = {1}; increment(clock); }
the clock variable must actually be instantiated like this : Counter clock {1};
clock
Counter clock {1};
the main function does not have a return statement
main
return
the clock variable is not modified by the increment function
increment
we cannot define a struct with only one attribute
struct