[ create a new paste ] login | about

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

C, pasted on Jan 28:
1
2
3
4
5
6
7
8
9
#include<stdio.h>
int main(){
 int a[10];
 int* p = a;
 ++p; // works
 ++(int*)p; // compiles
 ++(char*)p;  // Error
 return 0;
}


Output:
1
2
In function 'main':
Line 7: error: invalid lvalue in increment


Create a new paste based on this one


Comments: