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
Explain what is page thrashing?
Define Array of pointers.
Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?
What is a file descriptor in c?
What is the explanation for modular programming?
Suggesting that there can be 62 seconds in a minute?
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
A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers
What is the purpose of the statement: strcat (S2, S1)?
Write a program in c to replace any vowel in a string with z?
Wt are the Buses in C Language
Do you know the purpose of 'register' keyword?
What is oops c?
What is array in C
Write a program to swap two numbers without using third variable in c?