J
johny smith
Well,
I thought that I was creating a constant pointer, and would not be able to
increment it without a compiler error.
But this example compiles fine.
The const is to the left of the * so I thought this would force that to be
constanst.
What am I missing? thanks
#include <iostream>
void f( int const * a );
int main()
{
int a = 5;
f( &a );
return 0;
}
void f( int const * b )
{
b++;
}
I thought that I was creating a constant pointer, and would not be able to
increment it without a compiler error.
But this example compiles fine.
The const is to the left of the * so I thought this would force that to be
constanst.
What am I missing? thanks
#include <iostream>
void f( int const * a );
int main()
{
int a = 5;
f( &a );
return 0;
}
void f( int const * b )
{
b++;
}