Re: 'lvalue required as unary ‘&’ operand' Problem

Brian Budge brian.budge@gmail.com
Fri Nov 12 17:17:00 GMT 2010


:)  Indeed.  I wasn't diagnosing the logic mistakes.

  Brian

On Thu, Nov 11, 2010 at 6:14 PM, John Fine <johnsfine@verizon.net> wrote:
> That explains the compile error, but just fixing that, such as putting the
> sizeof() expressions in temporary variables, still leaves the bug, just
> hidden from the compiler.
>
> Those two address of size parameters refer to the filled size of the input
> buffer and capacity of the output buffer.  sizeof(pointer) is just the
> number of bytes the pointer itself occupies.  It says nothing about the
> usage nor capacity of the buffer pointed to by the pointer.
>
> Brian Budge wrote:
>>
>> You can't take the address of the sizeof() result.  This is probably a
>> more appropriate question for a c++ forum, as this is not gcc
>> specific.
>>
>> On Wed, Nov 10, 2010 at 9:21 AM, Rifat Mahmud <rftmhmd@gmail.com> wrote:
>>
>>>
>>>  n=iconv(c, &a, &sizeof(a), &d, &sizeof(b));/*The problem is here,
>>>
>
>



More information about the Gcc-help mailing list