Jak ja to kompiluję, to dostaję takie ostrzeżenia i błędy kompilacji:
ee.c:1:9: warning: macro name is a reserved identifier [-Wreserved-id-macro]
#define _CRT_SECURE_NO_WARNINGS
^
ee.c:9:16: warning: format specifies type 'char *' but the argument has type 'int' [-Wformat]
scanf("%c",znak);
~~ ^~~~
ee.c:10:5: warning: implicit declaration of function 'printLine' is invalid in C99 [-Wimplicit-function-declaration]
printLine(6,znak);
^
ee.c:9:16: warning: variable 'znak' is uninitialized when used here [-Wuninitialized]
scanf("%c",znak);
^~~~
ee.c:8:14: note: initialize the variable 'znak' to silence this warning
{ char znak;
^
= '\0'
ee.c:13:6: error: conflicting types for 'printLine'
void printLine(int width, char c)
^
ee.c:10:5: note: previous implicit declaration is here
printLine(6,znak);
^
ee.c:1:9: warning: macro is not used [-Wunused-macros]
#define _CRT_SECURE_NO_WARNINGS
^
5 warnings and 1 error generated.
Wszystkie tutaj faktycznie są problemem (być może poza _CRT_SECURE_NO_WARNINGS
, bo rozumiem że trzeba takie rzeczy robić w Visual Studio czasem), aczkolwiek najważniejszym z nich jest ten:
ee.c:9:16: warning: format specifies type 'char *' but the argument has type 'int' [-Wformat]
scanf("%c",znak);
~~ ^~~~