Converting array notation to pointer notation

int array[5]; Expressions such as array[3] gets converted to *(array+3) Or in void fun ( int *array[] ); *array[] gets converted to int **array I was wondering what does the array declaration int array[5]; Get converted to? Is it ...
more »

2017-05-09 10:05 (2) Answers

increment of pointer to array

I'm trying to understand why the following C++ code does not compile int main () { int a[10]; int (*p)[10] = &a; int *q = static_cast<int *>(++p); } If it's not obvious, what I was trying to do is find a pointer to the end of the a...
more »

2017-01-28 19:01 (1) Answers

types and pointers address

Suppose the first element of double u[100] has address 0x1000, and sizeof(double) is 8. What does printf("%p %p\n", &u[3] - 1, &u[20] - 5) output? The homework answer is echo '0x1010 0x1078' How did they do the second part &...
more »

2016-06-12 05:06 (2) Answers