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
can we have joblib in a proc ?
Can 'this' pointer by used in the constructor?
i want to know the procedure of qualcomm for getting a job through offcampus
Write a program to check palindrome number in c programming?
What is the purpose of & in scanf?
5 Write an Algorithm to find the maximum and minimum items in a set of ‘n’ element.
What is type qualifiers?
How can I rethow can I return a sequence of random numbers which dont repeat at all?
What are extern variables in c?
What is function and its example?
What is NULL pointer?
What is operator precedence?
What are the advantages of using new operator as compared to the function malloc ()?
Explain what’s a signal? Explain what do I use signals for?
Apart from dennis ritchie who the other person who contributed in design of c language.