invalid types `char[int]' for array subscript 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 #include <iostream>#include <stdio.h>usingnamespacestd;intmain () {intplayer;//Assign player numberdoubleH;//Assign variable for hitsdoubleO;//Assign ...
In function 'int main()': Line 52: error: invalid types 'char[int]' for array subscript compilation terminated due to -Wfatal-errors. Any ideas? Jun 5, 2013 at 2:02am vlad from moscow(6539) You defined heshecaps as a single character. So you may not use the subscript operator with...
void red(int n,int m,char *a1)char a1 --> char *a1;穿的是地址!void red(int n,int m,char *a1){ char *p;int i;p=&a1[m-1];for( i=0;i<m;i++,p++){printf("%c",*p);} }
void Rev(int Data[],const int &len)是不同的。我想你的本燃孝意应该是void Rev(int Data[],const int &len)这也就解释了在main中正确的原因,因为在main中定义的int Data[len];是正确伏段手的电压(U):电压是使电路中形成电流的原因,电源是提 展开回答 ...
Hello, I have this code that gives me the error from the title: This is problem statement: Given a string of "s" consisting of two words separated by space (first
invalid types ‘unsigned char[int]’ for array subscript [closed]Ask Question Asked 10 years, 2 months ago Modified 2 years, 11 months ago Viewed 8k times 1 Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused...
char marka[50] = "AUDI"; char model[50] = "R8 SPYDER"; int obujam[50] = {5204}; int masa[50] = {1720}; int max_snaga_kw[50] = {386}; int max_snaga_ks[50] = {535}; int max_brzina[50] = {313}; float ubrzanje[50] = {4.1}; ...
C++中的动态数组是以动态内存分配来实现的,即用new和delete动态分配和删除数组空间,所以像int Rev[len];这样的定义是非法的。根据楼主说的main函数中可以编译,那可能是在main函数中,len被赋予了常量,这样C++能够根据语法判断出实际是类似于int Rev[10]这样的定义,所以是可以编译通过的。但是在函数...
max函数中array变量是int*类型,它是int数组bai,后面只能一个下标,写了多处array[I][j],当做二维数组来用。max函数最后一个for循环,for循环应该有三部分,它们以分号隔开,这里只有一部分,没有分号隔开。include <iostream> using namespace std;int max(int (*array)[100],int I,int J,int...