Thread: My C-Compiler doesn't like else if?

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    34

    Angry My C-Compiler doesn't like else if?

    This script doesn't work! Pease help me and send me a message to my e-mail addy ([email protected]):

    .
    .
    .
    int main (int argc, char *argv[])
    {
    if ( argc = < 2)
    //usage menue!

    else if (argv[1] = "/usage1")
    //usage one

    else if (argv[1] = "/usage2")
    //usage two

    else
    printf("this usage inst known\n");


    Please help me!!!

  2. #2
    Green Member Cshot's Avatar
    Join Date
    Jun 2002
    Posts
    892
    >> if ( argc = < 2)
    you mean if(argc <= 2)

    >> argv[1] = "/usage1"
    You can't compare strings like that, use strcmp instead.
    Try not.
    Do or do not.
    There is no try.

    - Master Yoda

  3. #3
    Registered User moi's Avatar
    Join Date
    Jul 2002
    Posts
    946
    i'm just curious, why are there so many inexperienced coders that the FIRST thing they do is blame their compiler?
    hello, internet!

  4. #4
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Originally posted by moi
    i'm just curious, why are there so many inexperienced coders that the FIRST thing they do is blame their compiler?
    Duh! That's easy.... The compiler is supposed to be really clever, right? So it should be able to work out what we want, even if we don't ask it exactly how it expects. Therefore, when it doesn't understand our words, almost by definition, it must be broken. See, simple
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  5. #5
    and the Hat of Clumsiness GanglyLamb's Avatar
    Join Date
    Oct 2002
    Location
    between photons and phonons
    Posts
    1,110
    hmm i would trust all compilers except for lcc-win32 ...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiler Paths...
    By Cobra in forum C++ Programming
    Replies: 5
    Last Post: 09-26-2006, 04:04 AM
  2. C Compiler and stuff
    By pal1ndr0me in forum C Programming
    Replies: 10
    Last Post: 07-21-2006, 11:07 AM
  3. I can't get this new compiler to work.
    By Loduwijk in forum C++ Programming
    Replies: 7
    Last Post: 03-29-2006, 06:42 AM
  4. how to call a compiler?
    By castlelight in forum C Programming
    Replies: 3
    Last Post: 11-22-2005, 11:28 AM
  5. Bad code or bad compiler?
    By musayume in forum C Programming
    Replies: 3
    Last Post: 10-22-2001, 09:08 PM