1

I wander why c++ allows to declare this?

void f(int x);

int main()
{
     int x;
     const int y=0;
     f(x);
     f(y);
}

void f(const int x)
{
}

Why compiler allows you declare function with one signature, but define with another (cv qualifier added)?

Eduard Rostomyan
  • 7,050
  • 2
  • 37
  • 76

0 Answers0