Friday, June 25, 2010

C const pointer

void main()
{
const int * a;
*a = 5;
}

gcc error : assignment of read only location.

so, how to assign to *a, without using another variable? and what could be a use of a declaration like above?

Ans : 
void main()
{
const int * a;
*a = 5;
}

Ans 2 : 

No comments:

Blog Archive