class foo {
public:
static int func(const char*& p) const;
};
This is illegal, why?
Answer Posted / john gummadi
There is nothing to do with class members here, we don't
see any. The function takes a constant pointer as a
parameter, when it is constant it cannot be changed
(although technically we can change by casting), then you
cannot use reference (&).
But who knows, compilers may accept, I haven't tested.
Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
How can I discover how many arguments a function was actually called with?
What does 3 mean in texting?
Why is it important to memset a variable, immediately after allocating memory to it ?
Can we add pointers together?
Is flag a keyword in c?
What are different types of operators?
What is the difference between declaring a variable and defining a variable?
What is use of pointer?
largest Of three Number using without if condition?
What is the difference between the = symbol and == symbol?
What is the difference between array and linked list in c?
What is sizeof int?
How pointers are declared?
What is the use of parallelize in spark?
What is function prototype in c language?