I get the errror "error C2109: subscript requires array or pointer type".
I'm not sure why this doesn't work. The error happens when I try to set CFtemp2 = bnext[md]: sprintf(CFtemp2,"%i",bnext[md]):
I'm not sure why this doesn't work. The error happens when I try to set CFtemp2 = bnext[md]: sprintf(CFtemp2,"%i",bnext[md]):
Code:
#define MAXATM 60
#define MAXDEG 6
int bnext[MAXDEG+1][MAXATM+1];
char CFtemp[1000];//used for temparary storage variable when converting ints to chars
char CFtemp2[1000];//Secondary used for temparary storage variable when converting ints to chars for arrays
//functions fill bnext, now I try to loop through it:
for (i = 0 ; i <= MAXATM + 1 ; i++) {
sprintf(CFtemp,"%i",bnext[i]);
for (md = 0 ; i <= MAXDEG + 1 ; md++) {
int iRow = pQuery->AddRow() ;
sprintf(CFtemp2,"%i",bnext[i][md]);
pQuery->SetData( iRow, iCol1, CFtemp2 ) ;
pQuery->SetData( iRow, iCol2, CFtemp ) ;
CFtemp2[0] = '\0';
}
CFtemp[0] = '\0';
}