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

What is the explanation for the dangling pointer in c?

684


What do you mean by dynamic memory allocation in c? What functions are used?

662


What is the difference between the = symbol and == symbol?

631


Explain how can you determine the size of an allocated portion of memory?

629


Difference between linking and loading?

699






What do you mean by command line argument?

650


What is hashing in c?

648


Can you explain the four storage classes in C?

646


What is modifier & how many types of modifiers available in c?

614


Why is c faster?

596


Input is "rama loves rajesh and rajesh Loves rama also and rajesh wear gloves and bloves" To print output is count the numbers of times repeted the word love without case sensitive.

1600


Explain what does the format %10.2 mean when included in a printf statement?

786


Explain how does free() know explain how much memory to release?

577


Is it fine to write void main () or main () in c?

549


What is the difference between array and pointer in c?

585