I have a struct which contains some pointers. I want the value of these to be unmodifiable. But simply writing const infront doesn't make the structs members unmutable
typedef struct{
int *x;
int *y;
}point;
void get(const point *p,int x, int y){
p->x[0]=x;//<- this should not be allowed
p->y[0]=y;//<- this should not be allowed
}
Can someone point me in the right direction.
EDIT:
So it would seem that there is no simple way of using the function prototype to tell that everything belonging to the struct should be unmodifiable