Here is my example code :
I need help to create header file from my codeCode:#include <stdio.h> void Func() { static int x = 0; x++; printf("%d\n", x); } int main() { Func(); // prints 1 Func(); // prints 2 Func(); // prints 3 Func(); // prints 4 Func(); // prints 5 return 0; }
test.hCode:#include <stdio.h>#include "test.h" int main() { Func(); // prints 1 Func(); // prints 2 Func(); // prints 3 Func(); // prints 4 Func(); // prints 5 return 0; }
I am bit confused I don't have any idea how to make header file test.h from the programCode:static int x ; //code for header