a=a+1

50 views
Skip to first unread message

Arrvindh Shriraman

unread,
Sep 11, 2020, 9:23:37 PM9/11/20
to cmpt-295-sfu
Someone asked about whether you can write a = a+1
int main() {

  int a[10];
  int *p;
  p = a;
  a=a+1; error: incompatible types when assigning to type 'int[10]' from type 'int *'

  p = p + 1; // VALID.  is just set to p = &a[1]
  return 0;
}


Reply all
Reply to author
Forward
0 new messages