hey, 2nd C question, yee
1)
> but why do i have to write it this way:
(int *
)&a and not (int)*(&a)?
everything in the () is nothing but a *type*. so (int *) is just representig the type of a int-pointer.
> would be (int*)&a be the same, without the space between int and *?
yep, totally the same
> is the dereferenc-star * assigned to the int-cast or to the adress here?
in the context of a cast (int *) it is *not* dereferencing anything. it just indicates that is *is* a pointer and can be referenced later.
you can derefence references as often as you want and make jokes out of it:
PHP Code:
int i = 4;
printf("%d", *&*&*&*&i); // prints 4
// thats the same:
printf("%d", *(int *)&*&i); // 4
p = malloc( count * sizeof( int * ) );
size of what? an int-pointer?
yea, the size of a int-pointer. on 32bit = 4 byte, on 64bit = 8byte
p is a pointer-on-a-pointer... when you derefence it once, it is still a pointer, so you need to derefence it twice (**p). it's not needed in that example. ^^
2) you dont need to write any 1.0 or 1.0f
you can just write:
PHP Code:
float delta = 1;
every compiler is smart enough to recognise, what you want.