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 write a function analogous to scanf?
1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.
What are pointers? What are different types of pointers?
What is getch c?
What is function what are the types of function?
Why void main is used in c?
Can we compile a program without main() function?
Is array a primitive data type in c?
the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b
What is the purpose of the statement: strcat (S2, S1)?
What is the purpose of sprintf?
What are the different properties of variable number of arguments?
What is a rvalue?
What is cohesion and coupling in c?
How can I insert or delete a line (or record) in the middle of a file?