I have the following file named arr.c..
unsigned long* arr[50];
unsigned long arrSizes[50];
unsigned short size = 0;
void add(unsigned long* x, int y){
arr[size] = x;
arrSizes[size] = y;
size++;
}
void print() {
int i,j;
i=0;
j=0;
for(;i<size;i++){
for(;j<arrSizes[i];j++)
printf("%lu ",arr[i][j]);
printf("\n");
}
}
It prints an empty line, its not printing arr[2]. Any idea, why this might be happening?
in your
printmethodjstarts at 0, but it should be reset for each iteration of i.Why not do it the normal way: