Tell me more ×  I'm getting a strange error when reading my data
into an array. My goal is to read a file that has a single
column of numbers into an array, line-by-line.  #include
<stdio.h>  int main() {     int numArray = [20];     int i = 0;
FILE *infile;     infile = fopen("numbers", "r");       return
0; }  This is my compile error:  sort_algorithms.c: In function
‘main’: sort_algorithms.c:6: error: expected expression before
‘[’ token sort_algorithms.c:16: error: subscripted value is
neither array nor pointer  share|improve this question What's
the error? int numArray = [20] isn't valid syntax, you probably
meant int numArray[[20]? And perhaps most importantly, you've
got a gaping security hole—what happens if the file contains
more than 20 numbers in it? –  Adam Rosenfield Jul 19 '11 at
4:16 nick_name: that's not how you declare an array.... –  Mitch
Wheat Jul 19 '11 at 4:16 Are you by chance a python programmer?
–  Chris Jul 19 '11 at 4:16 Yes, I'm a Python programmer! – 
nick_name Jul 19 '11 at