Here,
Unlike scanf and wscanf, scanf_s and wscanf_s require you to specify buffer sizes for some parameters. Specify the sizes for all c, C, s, S
For scanf_s, wscanf_s (unlike scanf and wscanf), the buffer size must be specified for c, C, s, S, etc.
If you look at the example below, you can see that C also specifies the size as 1.
result = scanf_s( "%d %f %c %C %s %S", &i, &fp, &c, 1,
&wc, 1, s, (unsigned)_countof(s), ws, (unsigned)_countof(ws) );
© 2024 OneMinuteCode. All rights reserved.