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 / rafal dzbek

the 2nd const used in the example is invalid because it can
be used only with member functions which have a hidden
argument called this. The 2nd const would be applied to
this.
The funct is static member function so it hasn't any this
pointer.

Actually it is not obvious what is exactly inccorect.
We can remove static keyword, then we get syntactically
correct class definition, or we can remove 2nd const and
again the class can be considered valid.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do some versions of toupper act strangely if given an upper-case letter?

1043


1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.

2109


Can you define which header file to include at compile time?

988


WHICH TYPE OF JOBS WE GET BY WRITING GROUPS .WHEN THE EXAMS CONDUCTED IS THIS EXAMS ARE CONDUCTED EVERY YEAR OR NOT.PLS TELL ME THE ANSWER

1810


"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above

988


If errno contains a nonzero number, is there an error?

1306


What is the purpose of the preprocessor directive error?

1209


What is the benefit of using #define to declare a constant?

1055


Is array a primitive data type in c?

1007


Explain why c is faster than c++?

1012


Explain how do you list a file’s date and time?

1003


What is the role of && operator in a program code?

1026


Can we use visual studio for c?

1018


Write a code to determine the total number of stops an elevator would take to serve N number of people.

1203


What are the types of arrays in c?

1108