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 / john gummadi

"const" cannot be used along with reference. And the function itself is const which means it cannot change any parameters. So no place for the reference here. If you really need reference, then get id of consts.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

can we have joblib in a proc ?

2301


How can I split up a string into whitespace-separated fields?

1055


Is it better to bitshift a value than to multiply by 2?

1092


What does static variable mean in c?

1100


How do we make a global variable accessible across files? Explain the extern keyword?

1880


Why doesnt the call scanf work?

1192


find out largest elemant of diagonalmatrix

2247


explain what is fifo?

1069


What is function prototype in c language?

1031


What does typedef struct mean?

1105


How does placing some code lines between the comment symbol help in debugging the code?

992


Can a local variable be volatile in c?

989


How can you find the exact size of a data type in c?

1001


why use functions a) writing functions avoids rewriting the same code over and over b) using functions it becomes easier to write programs and keep track of what they are doing c) a & b d) none of the above

1155


What is the difference between malloc() and calloc()?

1846