Thread: main(int argc, char *argv[])

  1. #1
    Registered User
    Join Date
    Nov 2001

    main(int argc, char *argv[])

    I have a problem with main(int argc,char *argv[])

    The compiler says,"1705, function prototype is an ANSI ..."

    The funny thing is , this same code works perfectly well on another compiler...

    It looks to me that the compiler is really old, and it needs to be declared some other way.

    Would be much obliged if you could help me here.


  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    > It looks to me that the compiler is really old
    Looks like it's a transitional compiler, it knows what ANSI-C is, but prefers the old style

    1. Is this an error or a warning - if it's only a warning, you should still get valid code.
    2. Read the documentation - there should be a command line switch to make it accept ANSI without complaint.

    And yes, it really is too old - even if it compiles ANSI-C, it's almost certainly not compliant with the standard.

    > and it needs to be declared some other way.
    You don't want to go there....

  3. #3
    thanks for the reply, I think I have found the answer... it's like this...

    int main(argc,argv)int argc;char *argv[];

    return 0:

    by the way, i get an error and not a warning

    the same things happens everytime I declare a function, including main

  4. #4
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    > int main(argc,argv)int argc;char *argv[];
    > {

    Yes, you definately have an "old school" compiler. You really should get a newer one.

    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help understanding ? int main(int argc, char *argv[])
    By Sshakey6791 in forum C++ Programming
    Replies: 10
    Last Post: 12-07-2008, 06:11 AM
  2. int main(int argc, int *argv[])
    By salvadoravi in forum C Programming
    Replies: 5
    Last Post: 01-20-2008, 12:30 PM
  3. Replies: 14
    Last Post: 12-26-2004, 11:18 AM
  4. Replies: 18
    Last Post: 06-21-2003, 10:57 AM
  5. int main(int argc, char *argv[]) ?
    By Shadow12345 in forum C++ Programming
    Replies: 6
    Last Post: 04-22-2002, 04:50 PM