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
differentiate built-in functions and user – defined functions.
about c language
What are types of preprocessor in c?
When should the register modifier be used? Does it really help?
Which node is more powerful and can handle local information processing or graphics processing?
What is a nested loop?
write a proram to reverse the string using switch case?
Explain setjmp()?
What are the types of i/o functions?
What is the purpose of 'register' keyword?
Why is c so popular?
7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.
What are the restrictions of a modulus operator?
What are the two types of functions in c?
What is atoi and atof in c?