hello,
had trouble compiling this program and don't know whats the matter...........
and the compiler gives these errors:
it seems that i cant assign values to array elements B[0]
had trouble compiling this program and don't know whats the matter...........
Code:
#include<stdio.h>
#define NMAX 100
double NextB( double B[], int *firstK, int *lastK, int n);
int main() {
double B[NMAX+1];
double maxB;
int n, firstK, lastK,
B[0] = 0.5;
return 0;
}
and the compiler gives these errors:
it seems that i cant assign values to array elements B[0]
Code:
Cpp1.cpp(11) : error C2466: cannot allocate an array of constant size 0
Cpp1.cpp(11) : error C2371: 'B' : redefinition; different basic types
Cpp1.cpp(8) : see declaration of 'B'
Cpp1.cpp(11) : error C2440: 'initializing' : cannot convert from 'const double' to 'int []'
There are no conversions to array types, although there are conversions to references or pointers to arrays
Error executing cl.exe.