While I'm trying to explore possibilities of arrays in C in ANSI, I'm confronted with an issue. Here's my code:
#include <stdio.h>
#include <string.h>
static int MAXLIGNE = 5000;
char *ptrlig[MAXLIGNE]; // Ptr sur la ligne de txt // Got an issue:
// Variably modified ptrlig @ filescope
int lirelignes(char *ptrlig[], int nlignes);
void ecrirelignes(char *ptrlig[], int nlignes);
void trirapide(char *ptrlig[], int gauche, int droite)
Error from the GCC:
VARIABLY MODIFIED PTRLIG at FILESCOPE
I've seen that 'const' type may create that kind of issues. I tried to make it like:
#include <stdio.h>
#include <string.h>
static int MAXLIGNE = 5000;
unsigned char *ptrlig[MAXLIGNE];
But that doesn't seem to change anything in this case.