我有一个 char foo[SIZE]; //(string)
并使用正确输入%s
(如printfs
正确输入),但现在要将其设置为小写。所以我尝试使用
if (isupper(*foo))
*foo=tolower(*foo);
Run Code Online (Sandbox Code Playgroud)
即当我这样做:
printf("%s" foo); //I get the same text with upper case
Run Code Online (Sandbox Code Playgroud)
文字似乎没有改变。谢谢。