C++中如何调用puts(),gets()函数???
#include <iostream>
#include <cstring>
using namespace std;
int main()
{
char str[101];
gets(str);
if(str[0]>='a' && str[0]<='z')
str[0]-=32;
for(int i=1;i<strlen(str);i++)
{
if(str[i-1]==' ' && str[i]>='a' && str[i]<='z')
str[i]-=32;
}
puts(str);
return 0;
}
某些编译器下为何会出现如下编译错误???如何解决???
error: 'gets' was not declared in this scope
error: 'strlen' was not declared in this scope
error: 'puts' was not declared in this scope
C++中如何调用puts(),gets()函数???