So what error, exactly, does it give you?
"what is the problem?"
The error message will describe the problem - so read it carefully.
- If it says something is un-defined (or un-declared), then define (or declare) it;
- If it says something is illegal, then think about what would be legal at that point;
- If it says something in not allowed, then think about what is allowed at that point;
- etc, etc.
It may help to refer to a C textbook or other reference if you're unsure about terminology, and/or what the C language does allow...
https://blog.antronics.co.uk/2011/08/08/so-youre-thinking-of-starting-with-c/
If you're still stuck, please copy & paste the full text of the error from the 'Console' output view.
BTW: how to properly post source code:

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.