大家帮帮忙哈
#include <iostream>
using namespace std;
void main ()
{
int str[200];
int t=0,k;
{
for(int n=0;n<=200;n++)
str[t++]=n*n;
}
{
for(int i=0;i<100;i++)
{
k=strlen(str[i]);
for(int j=0;j<k;j++)
if(str[i]==str[--k])
cout<<str[i]<<endl;
}
}
}
//--------------------Configuration: 013 - Win32 Debug--------------------
Compiling...
013.cpp
G:\学习\编程\013\013.cpp(15) : error C2664: 'strlen' : cannot convert parameter 1 from 'int' to 'const char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
执行 cl.exe 时出错.
数组中的元素不能求长度吗?
如果要求出长度,该怎么办?