(/Za) Option
And 1 more simple question. When I turn off /Za "getch();" returns me an error. I have to change it to "_getch();", why? Will _getch compile with gcc on Linux?(I need to compile library I'm developing both on VS and gcc).
ANSI C does not define getch() but it does define getchar() (see 7.19.7.6 in the C Standard). Therefore with the /Za switch the Microsoft C compiler excludes the non-standard name 'getch' and instead just includes the standard name '_getch'. In ANSI C names that begin with a single '_' while they are strictly not part of the C Standard are reserved for library implementors: prepending a library name with '_' is a Standard way for implementors to provide non-standard or extended behavior.
If GCC strictly conforms to the C Standard then there should not be a library function named 'getch'. GCC may provide the _getch function but I am certain that it does provide the getchar function which should be equivalent.