c - How to create matrix, by reading the length in an input file -


i trying create matrix, int matrix1[size][size], have read length first line of file.

i can read read file no problem, when try declare matrix variable given me file there's compiling error.

how can around this?

sorry english

edited code:

int num;  file *fp;  fp = argc > 1 ? fopen(argv[1], "r") : stdin; if( fp == null) {     perror(argv[1]);      return -1; }  fscanf(fp,"%d", &num);  int matriz[num][num];     

error message warning: iso c90 forbids variable length array ‘matriz’


Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -