Re: NNTPC: Problem with 0.92 and SGI

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 12:23 21/08/1996 +0100, you wrote:
>Hi 'Ray Bellis', you wrote...
>> 
>> > Hi,
>> > 
>> > I get the following error, when I try to 'make' it on a Silicon-Graphics
>> > INDY with IRIX 5.3 and cc.
>> > 
>> > cfe: Error: list.c, line 162: This expression is not an lvalue.
>> >                 ((r==1)? p2->right: p2->left) = node;  
>> >                 ------------------------------^
>> 
>> Anyway, the solution is to make the code say this:
>> 
>>   *(((r==1)? &p2->right: &p2->left) = node;
>> 
>> Turning the two possible results from ?: into pointers makes them into
>> lvalues which can then be accessed using the * operator.
>
>Next error:
>cfe: Error: list.c, line 162: Syntax Error
>                *(((r==1)? &p2->right: &p2->left) = node;  
>                ----------------------------------------^
>*** Error code 1 (bu21)
>
>???
>
>Thanks,

The error is that you placed a '(' more than necessary.

you can also try
   if (r==1) p2->right = node;
   else      p2->left = node;
 
It should work for every compiler.
-------------------------------------------------------------------------------
 Alain RAYMOND, Ingenieur systeme                      Tel. : (33) 41.81.66.55
 IMA, 3 Place Andre Leroy, 49008 ANGERS CEDEX 01       Fax. : (33) 41.81.67.00
            http://www.math-appli-uco.fr/personnes/raymond
-------------------------------------------------------------------------------


[Index of Archives]     [Yosemite]     [Yosemite Campsites]     [Bugtraq]     [Linux]     [Trn]

Powered by Linux