C Program Compilation in Linux

This is a discussion on C Program Compilation in Linux within the C Programming forums, part of the General Programming Boards category; 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 ...

  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, 02: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, 09: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, 01:13 PM
  5. simple program on linux
    By finnepower in forum Linux Programming
    Replies: 10
    Last Post: 05-29-2004, 04:10 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21