I've tried the following test program:
#define N 10
void main()
{
int a[N,N], i, j;
for (i = 0; i < N; i++)
for (j = 0; j < N; j++)
a[i, j] = N * i + j;
}
The compiler says:
% cc -o atest -g atest.c
/usr/lib/cmplrs/cc/cfe: Error: atest.c, line 6: Syntax Error
int a[10,10], i, j;
--------^
% lint atest.c
"atest.c", line 6: error: syntax error
"atest.c", line 10: warning: a undefined
"atest.c", line 10: error: illegal indirection
"atest.c", line 12: warning: main() returns random value to invocation environment
What's going on here?
Jon
---
Dr. Jon Brinkmann Apache Point Observatory
Instrument Scientist 2001 Apache Point Road
Internet: brinkmann_at_nmsu.edu P.O. Box 59
URL: http://www.apo.nmsu.edu/brinkmann/ Sunspot, NM 88349-0059
Received on Thu May 15 1997 - 19:05:04 NZST