This is just weird. I'm trying to iterate through an array of structures, passed as a pointer like so:
void creeaza(Digraf* d,char* filename)
Where the type Digraf is defined through these structures:
typedef
struct l{ int nr;l* next;
}*LIST_AD;
typedef
struct{LIST_AD laI;
//first element if internal listLIST_AD laE;
//first element of external listLIST_AD lvf;
}HEAD;typedef
HEAD Digraf[1000];Now when trying to do the following inside the above-mentioned creeaza function, the program crashes. Well to be more specific, the first printf statement works, all the addresses are displayed correctly. However, inside the for loop, when i becomes 2, the program crashes and throws an exception at the line directly under the for statement. Could anyone tell me what's going on Thanks in advance.
#ifdef
DEBUGprintf(
"d[0], d[1], d[2], d[3]: %p %p %p %p\n",&d[0], &d[1], &d[2], &d[3]);getc(stdin);
#endif
for(i = 0; i < n; i++){d[ i ] -> laE = d[ i ] ->l aI = d[ i ] -> lvf = NULL;
[...] //some code ommitted
}

Exception when accessing an array element
Joachim Meyer
RyanRos
Then please post EXACTLY what your debugging efforts have indicated.
Ronald Laeremans
Visual C++ team
Yovav