[ create a new paste ] login | about

Link: http://codepad.org/yAJmxtgd    [ raw code | output | fork ]

C, pasted on Nov 1:
1
2
3
4
5
6
7
8
9
10
11
#include <stdio.h>
int main() {
  const char *a[] = {"abc", "def", "efg" };
  char const *b[] = {"ABC", "DEF", "EFG" };
  const char **h = &a[0];
  h = &b[0];
  *(h + 1) = "XYZ";
  printf("%c\n", *(*(h + 2) + 1));
  /* *(*(h + 2) + 1) = 'Z'; */ /* NG */
  return 0;
}


Output:
1
F


Create a new paste based on this one


Comments: