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


Please Help Members By Posting Answers For Below Questions

Combinations of fibanocci prime series

1116


What are terms in math?

597


What is the usage of the pointer in c?

608


What is a macro?

661


Write an algorithm for implementing insertion and deletion operations in a singly linked list using arrays ?

3060






Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create.

1484


How do you write a program which produces its own source code as output?

611


What is the process to create increment and decrement stamen in c?

590


What are the differences between new and malloc in C?

612


What is the scope of an external variable in c?

572


In C programming, what command or code can be used to determine if a number of odd or even?

627


Write a program to implement queue.

669


Explain what is gets() function?

639


What are the main characteristics of c language describe the structure of ac program?

616


Explain what is operator promotion?

639