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
design and implement a data structure and performs the following operation with the help of file (included 1000 student marks in 5 sub. and %also) 1.how many students are fail in all 5 subjects (if >35) 2. delete all student data those are fail in all 5 subjects. 3. update the grace marks (5 no. if exam paper is 100 marks) 4. arrange the student data in ascending order basis of marks. 5.insert double of deleted students with marks in the list.
Why clrscr is used after variable declaration?
What are keywords c?
difference between object file and executable file
What is scope rule in c?
Tell me the use of bit field in c language?
How can you tell whether a program was compiled using c versus c++?
Do you know the use of fflush() function?
difference between native and cross compilers
Disadvantages of C language.
I need a help with a program: Write a C program that uses data input in determining the whole of points A and a whole of circles B. Find two points in A so that the line which passes through them, cut through the maximum number of circles.
List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.
What is an auto keyword in c?
Is it possible to execute code even after the program exits the main() function?
How can I call fortran?