×

Loading...

run this code to see what the second const mean:

blaise (blaise)
#include "stdio.h"
class a
{
public:
void f(){printf("non const version\n");};
void f()const{printf("const version\n");};
};

void main()
{
a instanceofa;
const a constantinstanceofa;
instanceofa.f();
constantinstanceofa.f();
}

in fact, besides meaning it should change nothing of the instance, it also stands for a selector.
(#129525@0)
2001-7-12 -04:00
This post has been archived. It cannot be replied.
Page address has been copied. To share, click to copy page address.
Share Online by QR Code

Back To Topic: C++ language question

Back To Forum: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论