经典问题----strlen was not declared in thos scope

示例

#include<stdio.h>
#include<iostream>
#include<cstring>//**<string.h>是不包括strlen的,要使用cstring**

using namespace std;
char st[]="hello!";

int main(){

int l=strlen(st);
st[l]='w';
for(int i=0;i<l;i++){
    cout<<st[i];
}
return 0;
}

猜你喜欢

转载自blog.csdn.net/chunjiekid/article/details/79622418
今日推荐