#include
Int main () {
Char STR [6].
Scanf_s (" % s ", STR);
Int CNT=0;
For (CNT=0; CNT & lt; 5; Cnt++) {
If (STR (CNT) & gt;='A' & amp; & STR (CNT) & lt;='B') {
STR (CNT) -='32';
}
Printf (" % s ", STR (CNT));
}
return 0;
}
Run to scanf_s that row times wrong is as follows:
0 x7ab1e63c (ucrtbased. DLL) (located in Project1. Exe) caused by abnormal: 0 xc0000005: when writing position 0 x00b00000 access conflict,
Which ensures that the input is 5 characters, such as: appLe,
CodePudding user response:
Scanf_s (" % 5 s ", STR, 6);https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/scanf-s-scanf-s-l-wscanf-s-wscanf-s-l? View=MSVC - 160 & amp; ViewFallbackFrom=v - 2019
CodePudding user response: