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

How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same

1052


What is an array? What the different types of arrays in c?

1104


What is the sizeof () operator?

1017


When I tried to go into a security sites I am denied access and a message appeared saying 'applet not initialize'. How can I rectify this problem.

1934


Write a program to reverse a string.

1025


Give basis knowledge of web designing ...

1981


Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].

1053


What is indirection? How many levels of pointers can you have?

1089


how to find binary of number?

4336


List a few unconditional control statement in c.

929


what is the different bitween abap and abap-hr?

2216


What are the 5 elements of structure?

1040


How do you define structure?

993


What are the advantages of using linked list for tree construction?

1024


if (i = 0)printf ("True"); elseprintf("False"); Under what conditions will the above print out the string "True" a) Never b) Always c) When the value of i is 0 d) all of the above

1108