Created
November 4, 2016 04:23
-
-
Save mattroz/fb0c4e02bb31fe86333888369f1c6f15 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
See comments below |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
int x[] = {1, 2, 3}; printf("%d\n%d\n", x[1], 1[x]);
- Оператор косвенного обращения! принимает указатель в качестве аргумента и возвращает содержание ячейки, на которую тот указывает. Если v — указатель, то !(v+i) будет обращаться к ячейке с адресом v+i. Бинарная версия оператора! определена так, что v!i = !(v+i). v!i ведет себя как индексированное представление, где v — одномерный массив, а i — индекс типа integer. Заметьте, что в языке BCPL v5= !(v+5) =! (5+v) = 5!v. То же происходит и в языке Си: v[5] = 5[v]