Go Back   The UNIX and Linux Forums > Top Forums > Programming
Search Forums:



Programming Post questions about C, C++, Java, SQL, and other programming languages here.

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 04-26-2009
Registered User
 

Join Date: Aug 2008
Posts: 37
Thanks: 0
Thanked 2 Times in 1 Post
Need help compiling in C: lvalue required as left operand of assignment

Hi,

I am trying to compile a program (not coded by me), and i'm getting this error:

Code:
203: error: lvalue required as left operand of assignment

As you may be guessing, the program doesn't compile, the line number 203 is the following:


Code:
if(((int)msg=addc(iphp,tcphp)))if(verbosity)fprintf(stderr,"%c%s",0x08,msg);

What am i missing? what's wrong here?

PostData: if someone wants to know which program it is, it's route's juggernaut, from phrack magazine.

Please, help!
Sponsored Links
    #2  
Old 04-26-2009
Moderator
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 12,127
Thanks: 230
Thanked 1,686 Times in 1,618 Posts
It's probably that (int). You can't assign to something that's been typecast.
Sponsored Links
    #3  
Old 04-26-2009
Registered User
 

Join Date: Aug 2008
Posts: 37
Thanks: 0
Thanked 2 Times in 1 Post
Hi,
Thanks for the reply, I did it modifiying it like this:

before:
Code:
if(((int)msg=addc(iphp,tcphp)))if(verbosity)fprintf(stderr,"%c%s",0x08,msg);

after:
Code:
if((msg=addc(iphp,tcphp)))if(verbosity)fprintf(stderr,"%c%s",0x08,msg);

You were right, thank you

Last edited by Zykl0n-B; 04-26-2009 at 09:18 PM..
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
syntax error: `-a' unexpected operator/operand in IF dba.admin2008 Shell Programming and Scripting 4 11-14-2008 04:16 PM
Script required to get a required info from file. Pls. help me. ntgobinath Shell Programming and Scripting 2 05-31-2008 08:34 AM
Avoid "++ requires lvalue" Error in Loop Calculation sandeepb Shell Programming and Scripting 3 09-24-2007 07:02 AM
what left of the pattern mpang_ Shell Programming and Scripting 2 11-02-2006 02:42 PM
no space left on device kristy UNIX for Dummies Questions & Answers 1 05-29-2001 10:02 AM



All times are GMT -4. The time now is 11:14 PM.