Home > Back-end >  Letter case conversion
Letter case conversion

Time:09-26

Type a letter, all in lowercase output, why the following code won't run on vs2015

CodePudding user response:

Seek help from a great god ha, arrow where will go wrong, how to do

CodePudding user response:

Brother, you arrow there should not be ch, and should be a?
There is also a, is the best (a>='A' & amp; & A. & lt;='Z') use parentheses

CodePudding user response:

 # include 
Int main ()
{
Char a;
Printf (" do input the character \ n ");
The scanf (" % c ", & amp; A);
Char ch=(a & gt;='A' & amp; & A. & lt;='Z'? A + 32: a);//-- -- -- -- -- -- -- pay attention to this line of code changes -- -- -- -- -- -- -- -- -- --
Printf (" % c ", ch);
Return 0;
}

VS2015 c + + environment debugging results

CodePudding user response:

Vs2015 run don't chat, first to confirm whether the successful compilation, does not support the scanf under vs, should be scanf_s

CodePudding user response:

Ch undefined, brother, you enter the stored in a
  • Related