注册 登录
编程论坛 C++教室

[讨论]?????????????????????????????

NBxiaolong 发布于 2007-04-29 14:30, 387 次点击

#include<iostream>
using namespace std;
int main()
{
int index=1;
int searchNumber=25,numElements=101;
int myArray[102];
int fun1();
cout<<fun1()<<endl;
for (int i=0;i<numElements;i++)
{
int myArray[102]={fun1()};
if (myArray[i]==searchNumber)
{
index=i;break;
}
}
if(index!=NULL)
cout << "Number found at index " << index << endl;
else
cout <<"Number not found in array." << endl;

system("pause");
return 0;
}
int fun1()
{
int sub_f[101];
for(int x=1;x<100;x++)
{
sub_f[101]=x;
}
return sub_f[101];
}

7 回复
#2
NBxiaolong2007-04-29 14:40
大家随意讨论
#3
NBxiaolong2007-04-29 14:59
怎么没人说话??
#4
Janlex2007-04-29 15:02
int fun1()
{
int sub_f[101];
for(int x=1;x<100;x++)
{
sub_f[101]=x;
}
return sub_f[101]; //
}
#5
NBxiaolong2007-04-29 15:25
int fun1()
{
int sub_f[101];
for(int x=1;x<100;x++)
{
sub_f[101]=x;
}
return sub_f[101]; //
}
//楼上的朋友估计是今天胃不舒服,能说说把地面搞脏的原因么
#6
NBxiaolong2007-04-29 15:29
我感觉这个东西像是篇作文
#7
Janlex2007-04-29 15:43
int a[5];

int a[0] = 0;
int a[1] = 1;
int a[2] = 2;
int a[3] = 3;
int a[4] = 4;

int a[5]????

#8
谁与争疯2007-04-29 23:00
超出数组末尾.
1