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 / jaroosh

This code is obviously wrong, and here is why :
declaring a method to be const, means :
this method cannot CHANGE values of any member variables,
but while the method already is static, it has no means of
changing values of member variables, because simply - it
cannot see them (its belongs to a CLASS, not any specific
OBJECT).

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is page thrashing?

1101


Define Array of pointers.

1108


Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?

1022


What is a file descriptor in c?

1137


What is the explanation for modular programming?

1216


Suggesting that there can be 62 seconds in a minute?

1049


write a programe to accept any two number and check the following condition using goto state ment.if a>b,print a & find whether it is even or odd and then print.and a

1953


A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers

1206


What is the purpose of the statement: strcat (S2, S1)?

1171


Write a program in c to replace any vowel in a string with z?

1130


Wt are the Buses in C Language

3221


Do you know the purpose of 'register' keyword?

1023


What is oops c?

1249


What is array in C

1165


Write a program to swap two numbers without using third variable in c?

1132