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
  • 6,736
  • 1
  • 29
  • 67

0 Answers0