Thread: compiling error

  1. #1
    Registered User
    Join Date
    Aug 2011

    compiling error


    it is a problem when i compile my program and it says:
    375:9: error: expected identifier or ( before numeric constant
    397:9: error: lvalue required as left operand of assignment

    this is the code:
    int buihsort(float volt[fat], float resist[fat], float inductance[fat], float imped[fat], float ampere[fat], float power[fat])
      int i, j;
      float im=0;
      float v=0;
      float asist=0;
      float in=0; //this is the 375 line
      float am=0;
      float po=0;
      for (i = (fat - 1); i > 0; i--)
        for (j = 1; j <= i; j++)
          if (imped[j-1] > imped[j])
            im = imped[j-1];
            imped[j-1] = imped[j];
            imped[j] = im;
            v = volt[j-1];
            volt[j-1] = volt[j];
            volt[j] = v;
            asist = resist[j-1];
            resist[j-1] = resist[j];
            resist[j] = asist;
            in = inductance[j-1]; // this is the 397 line
            inductance[j-1] = inductance[j];
            inductance[j] = in;
            am = ampere[j-1];
            ampere[j-1] = ampere[j];
            ampere[j] = am;
            po = power[j-1];
            power[j-1] = power[j];
            power[j] = po;
    Please help me anyone....

  2. #2
    Join Date
    Dec 2007
    Is in defined anywhere else in your program as a global of some sort?

  3. #3
    Registered User
    Join Date
    Jun 2005
    That code will not give those errors you report.

    If "fat" is a const integral value, then there are no problems with that code. If "fat" is not defined as an integral value, the code will not compile, but will give errors on the argument list for the function. Those errors will differ from what you have described.

    The possible causes of your error message are endless. Three obvious possibilities are

    1) They correspond to another source file, and you have misinterpreted them.
    2) Code you have not shown in the source file from which you have extracted these lines is somehow responsible for the error.
    3) When compiling, you have defined some macros (possibly in an included header) that conflict with your code. Such as a macro named "in".

    Whatever the cause is, the information you have provided here is insufficient for someone else to identify the problem for you.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. a Compiling error?
    By kiros88 in forum C Programming
    Replies: 12
    Last Post: 05-21-2010, 12:32 PM
  2. compiling error
    By rajdey1 in forum C++ Programming
    Replies: 2
    Last Post: 04-17-2008, 01:44 AM
  3. Compiling error (need help)
    By JLBSchreck in forum C++ Programming
    Replies: 3
    Last Post: 04-14-2003, 08:30 PM
  4. Compiling error (Maybe a syntax error)
    By davidvoyage200 in forum C++ Programming
    Replies: 6
    Last Post: 03-27-2003, 10:09 PM
  5. error compiling
    By Unregistered in forum C++ Programming
    Replies: 4
    Last Post: 05-23-2002, 10:33 PM

Tags for this Thread