Arrays / Pointers (C)

in C: *(array)equivalent array[0]?

Hence is *(array+2)equivalent to array[2]?

+3
source share
4 answers

Yes, for example:

Given:

int a[10];

Then

*(a + 2)

equivalently

a[2]

and only for good measure.

a[2]

equivalently

2[a]
+9
source

You can look at this for more help: http://www.ibiblio.org/pub/languages/fortran/append-c.html

4) Taking an index with the value i, the equivalent to the operation: "pointer-add i, and then type-dereference the amount", i.e.

      xxx[i] = *(xxx # i)

As already mentioned, the answer is yes, but you can better understand.

+2
source

: .

0

. ( 15- .)

0

Source: https://habr.com/ru/post/1721242/


All Articles