简体   繁体   English

tolower()函数在C99中不起作用

[英]tolower() Function not Working in C99

I am using the CS50 appliance from Harvard and trying to make a character lowercase. 我正在使用哈佛大学的CS50设备,并尝试使字符小写。 I am trying to use the tolower() function but when I try to use it I get the message implicit declaration of function 'tolower' is invalid in C99 . 我正在尝试使用tolower()函数,但是当我尝试使用它时,我得到消息消息implicit declaration of function 'tolower' is invalid in C99 Anyone care to elaborate on why I would be getting this message. 任何人都想详细说明为什么我会收到此消息。 I have included stdio.h as well as string.h . 我已经包括了stdio.hstring.h

To use tolower in C99, use #include <ctype.h> 要在C99中使用tolower ,请使用#include <ctype.h>

It is not an I/O function and it doesn't operate on strings (it operates on characters), so it's not in stdio or string . 它不是I / O函数,并且不对字符串进行操作(对字符进行操作),因此不在stdiostring

tolower is defined in ctype.h . tolowerctype.h定义。 That is the file you should be including: 那是您应该包括的文件:

#include <ctype.h>

will solve your problem. 将解决您的问题。

它是在ctype.h中定义的,而不是在您提到的那些标头中定义的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM