:\FunshionMedia\C語(yǔ)言程序\Microsoft Visual Studio\c++1\C++面向?qū)ο骪第一課時(shí)\實(shí)驗(yàn)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 時(shí)出錯(cuò).實(shí)驗(yàn)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;}
為什么我這個(gè)程序提示的錯(cuò)誤這樣的?
湖上湖
2023-03-16 16:16:16