Hello I have this array and I seem to forget how to naviagte through it.
Line* line = (Line*) malloc(sizeof(Line)*line_count);
for (int i = 0; i <line_count; i++){
(line + i) ->blocks = make_blocks(block_count);
(line + i) ->block_count = block_count;
}
Logic:
Line is a pointer to the start of this continuous block of memory. I want to adjust the line pointer by 1 (the size of the line) and make blocks for that specific line and set the block count.
The above (line + i) does not work I have tried line[i] (line + i)* &line[i] but still nothing
Can anyone show me the light ? Its really dark where im sitting.
Thanks