:\FunshionMedia\C語言程序\Microsoft Visual Studio\c++1\C++面向對象\第一課時\實驗0001\wy.cpp(9) : error C2664: 'strlen' : cannot convert parameter 1 from 'int [20]' to 'const char *'Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style castlwy.c執(zhí)行 cl.exe 時出錯.實驗0001.exe - 1 error(s), 0 warning(s),求高人幫忙?謝謝#include<iostream>#include<string>#include<cstring>using namespace std;void main(){int a[20]={1,2,3,4,5,6,7};cout<<strlen(a)<<endl;}
為什么我這個程序提示的錯誤這樣的?
湖上湖
2023-03-16 16:16:16
