Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

class foo {
public:
static int func(const char*& p) const;
};

This is illegal, why?

Answer Posted / abdur rab

A member function can be declard as Const by considering
the fact that they contain a hidden "this pointer" to be a
pointer to a const object. However Static methods do not
have the "this pointer", and hence can't be const or
virtual.

Hence it is illegal to declare a static function as const.

The C++ language standard stipulates at section 9.4.1
that "[...] A static
member function shall not be declared const

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is getche() function?

994


what type of questions arrive in interview over c programming?

1989


How do we open a binary file in Read/Write mode in C?

1199


a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above

1342


hi any body pls give me company name interview conduct "c" language only

2252


All technical questions

1935


What is c++ used for today?

1068


Why array is used in c?

977


What is difference between && and & in c?

1058


Is calloc better than malloc?

978


What is #include stdlib h?

1066


What is pass by value in c?

1022


When should you use a type cast?

1067


Create a simple code fragment that will swap the values of two variables num1 and num2.

1241


What is function and its example?

1126