Code still compile when there is a mis-match in .h and .cpp

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

i am usingn gcc 4.1.0 on RedHat

In my .h file, I declare this:
class A{
public:
   void f1 (const B* bPtr);

};

But In my .cpp, I do this:

void A::f1(B* bPtr) {
//....

}

My question is I miss 'const' in my implementation (.cpp), why the
code still compile?

Is there an option that I should turn on so that the compile is more standard?

Thank you.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux