This is probably sourced by the template overload of the
gets_s()
function which might behave differently with debug builds.
I tried this with VS 2017 and it compiles fine in debug mode:
char ch[10];
gets_s(ch);
So it might be of interest how your
ch
variable is declared.
To avoid the error you can pass the size explicitly:
char ch[10];
gets_s(ch, sizeof(ch));