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
can we have joblib in a proc ?
How can I split up a string into whitespace-separated fields?
Is it better to bitshift a value than to multiply by 2?
What does static variable mean in c?
How do we make a global variable accessible across files? Explain the extern keyword?
Why doesnt the call scanf work?
find out largest elemant of diagonalmatrix
explain what is fifo?
What is function prototype in c language?
What does typedef struct mean?
How does placing some code lines between the comment symbol help in debugging the code?
Can a local variable be volatile in c?
How can you find the exact size of a data type in c?
why use functions a) writing functions avoids rewriting the same code over and over b) using functions it becomes easier to write programs and keep track of what they are doing c) a & b d) none of the above
What is the difference between malloc() and calloc()?