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);} }
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
I think you intended bytes to be an array of unsigned char but you only decalred it as a single unsigned char value. u16 crcGenerate(unsigned char bytes[], int len){ Share Follow answered Jul 9, 2014 at 15:43 hugomg 69.6k2727 gold badges164164 silver badges252252 bronze badges ...
[Error] invalid types 'char[int]' for array subscript #include <stdio.h> #include <stdlib.h> int main() { char a[20]; char out[9]; int i,m,n; FILE *fp; printf("请输入20个单词:\n"); gets(a); if((fp=fopen("e:\\1.txt","w"))==NULL) { printf("文件打开失败!\n"...
根据楼主说的main函数中可以编译,那可能是在main函数中,len被赋予了常量,这样C++能够根据语法判断出实际是类似于int Rev[10]这样的定义,所以是可以编译通过的。但是在函数中,上述定义是不行的,因为函数调用时,编译器无法判断传递来的参数是否是编译期的常量,这样就构成了动态数组的定义,这在C++中...
: error: invalid types `int[int]' for array subscript for(inti=1;i<=N;i++){if(Sl[i]>=m&&Sl[i]<n)n=Sl[i];}... for(int i=1;i<=N;i++) { if(Sl[i]>=m&&Sl[i]<n) n=Sl[i]; } 展开 C++不支持动态数组,比如像Basic中的Redim,Pascal中的SetLength等C++中的
cout<<"argc["<<i<<"]=["<<argv[i]<<"]"<<endl;//vvvvvvvvvvvvv