Привет, многоуважаемый all.
void f(const int &c)
{
int *p = (int *) &c;
*p = 10;
printf(«%i\n», *p);
printf(«%i\n», c);
}
int main(int argc, char *argv)
{
const int c = 2;
f(c);
printf(«%i\n», c);
return 0;
}
Выводит:
10
10
2
Почему?