当我运行它时给我一个错误 [英] give me an errore when i run it
本文介绍了当我运行它时给我一个错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
void fun (char[],int,int);
void fun (char Array[], int ArrayA,int ArrayB)
{
const int Arraysize=27;
char Array[Arraysize]="THIS IS MY SECOND HOMEWORK";
for(int i=0; i!='\0';i++)
cout<<Array[ArrayA,ArrayB];
}
int main()
{
char Array[27];
int a,b;
cout<<"ENTER THE FIRST NUMBER IN THE RANGE:";
cin>>a;
cout<<"ENTER THE SECOND NUMBER IN THE RANGE:";
cin>>b;
fun(Array,a,b);
}
推荐答案
for(int i=0; i!='\0';i++)
i
是整数,因此需要从零开始计数.您只是将它与一个空字符进行比较.
i
is an integer so needs to count up from zero. You are just comparing it to a null character.
您希望发布多少次?
使用Array的C ++代码 [
How many time you like to post it?
c++ code using Array[^]
Better to first start thinking and trying and then ask a question :(
Regards
这篇关于当我运行它时给我一个错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文