Ads
Ads
typedef struct{
int b;
}goo;
int foo(const goo* a){
((goo*)a)->b++; // idiot!
//a->b++; // error: increment of member ‘b’ in read-only object
}
int main()
{
goo goo1;
goo1.b = 0;
foo(&goo1);
return 0;
}
Ads