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
What is the explanation for the dangling pointer in c?
What do you mean by dynamic memory allocation in c? What functions are used?
What is the difference between the = symbol and == symbol?
Explain how can you determine the size of an allocated portion of memory?
Difference between linking and loading?
What do you mean by command line argument?
What is hashing in c?
Can you explain the four storage classes in C?
What is modifier & how many types of modifiers available in c?
Why is c faster?
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.
Explain what does the format %10.2 mean when included in a printf statement?
Explain how does free() know explain how much memory to release?
Is it fine to write void main () or main () in c?
What is the difference between array and pointer in c?