Thread: C Program Compilation in Linux

  1. #1
    Registered User
    Join Date
    May 2005
    Posts
    1

    Unhappy C Program Compilation in Linux

    I have prepared a C Program in LINUX which has the following command line:

    AP[i][j]*temp.T[i][j] = AE[i+1][j]*temp.T[i+1][j]+AW[i-1][j]*temp.T[i-1][j]+ AN[i][j+1]*temp.T[i][j+1]+ AS[i][j-1]*temp.T[i][j-1];

    the error message on compilation is: invalid lvalue assignment.
    Why is this error coming? I am not able to understand how to get over this error. Please suggest.

    Thanks

    Sanjib

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    143
    well, AP[i][j]*temp.T[i][j] gives a result. You can't assign anything to a result. The C programming language will not solve equations for you, you have to do that yourself! To take a simpler example:
    Code:
    /* say I want to solve the equation a * b = c + d ... */
    double a,b,c,d;
    /* I know b, c and d. I want to solve for a */
    b = 5.0; c = 20.0; d = 15.0;
    
    a = (c + d) / b;
    
    /* print out the answer */
    printf("answer: a = %g\n", a);
    DavT
    -----------------------------------------------

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Program Plan
    By Programmer_P in forum C++ Programming
    Replies: 0
    Last Post: 05-11-2009, 01:42 AM
  2. Sample Semaphore program on linux
    By ashok449 in forum C Programming
    Replies: 13
    Last Post: 02-09-2008, 02:25 AM
  3. Compiling a C program in Linux
    By hern in forum C Programming
    Replies: 14
    Last Post: 06-28-2004, 08:33 PM
  4. A C++ program in Solaris that cannot be ported to Linux
    By tvenki in forum C++ Programming
    Replies: 2
    Last Post: 06-11-2004, 12:13 PM
  5. simple program on linux
    By finnepower in forum Linux Programming
    Replies: 10
    Last Post: 05-29-2004, 03:10 PM