|
-
July 11th, 2010, 11:34 AM
#7
Re: A question regarding char*&
 Originally Posted by LarryChen
I don't quite understand your reasoning. Since a char array might be convertiable to a char*, so why is it a problem that it is not a char*?
in technical terms, the problem is that the pointer to which the array decays is an r-value and you can't bind a non const reference to an r-value. For example, if you change foo signature to "void foo( char* const&)" then it will compile.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|