Hello,
Im working on a potentially large project, with OpenGL. I access model data through arrays of arrays (pointers to pointers).
However, I questioned myself wether to use this or one large array, since I presume pointers to pointers require twice lookup? I really doubt about this and Im not sure wether to use arrays of arrays (easier to read) or one pointer/array.
Futhermore, is using pointers slower than using the variable?
eg:
int a, *b;
b = new int;
a = 1;
*b = 1; // does this have a difference in speed?
If I call a variable, like above here a = 1, what happens? I go to memory of a and change the bits to value "1"?
So if this is true, then in principle *b is just the same, but different for the compiler? I just use the address given by b to access that memory and do the same as with variable a? These things are properties for compiler right? when I type a = ... or c = a + sth then when I call a, I get he value, so isn't "a" just *(&a) ? So as I asked, are pointers / references slower?