class foo {
public:
static int func(const char*& p) const;
};

This is illegal, why?

Answer Posted / john gummadi

"const" cannot be used along with reference. And the function itself is const which means it cannot change any parameters. So no place for the reference here. If you really need reference, then get id of consts.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the difference between ++u and u++?

640


What are unions in c?

582


Explain spaghetti programming?

684


What is the difference between local variable and global variable in c?

691


State two uses of pointers in C?

640






How can I open a file so that other programs can update it at the same time?

660


Can we assign integer value to char in c?

617


What is the difference between near, far and huge pointers?

628


What is hash table in c?

574


What is const and volatile in c?

566


What are categories used for in c?

568


How to throw some light on the b tree?

605


Explain the meaning of keyword 'extern' in a function declaration.

726


How can I read in an object file and jump to locations in it?

579


what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;

2008