Thread: Return 0 undeclared?

  1. #16
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Interesting laserlight. Thanks for that. I've been lazy about buying the Standard to be honest. Since I'm still going through my early apprenticeship of C, I've not been very motivated to do it. But I think it's time.

    "Obsolescent feature" is the kind of wording to take seriously on a language standard, despite we knowing it will never be dropped. So int main(void), indeed.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  2. #17
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    > I've been lazy about buying the Standard to be honest.

    Unless you're writing your own implementation, the freely available draft standard is sufficient.

    > "Obsolescent feature" is the kind of wording to take seriously on a language standard

    Indeed.

    > despite we knowing it will never be dropped.

    That's what we said about gets, and look what happened.
    My best code is written with the delete key.

  3. #18
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,688
    Hmmm Interesting.

    This is using VS 2008 Professional.

    Code:
    #include <stdio.h>
    
    int main()
    {
       return 0;
    }
    Compiling to Manifest....
    Build: 1 Succeeded 0 Fail 0 Up-to-Date
    Same piece of code compiled with the LCC:

    Compiling....
    Dir:C\:AdaSkylaRose\.....\dummy.c
    Results:
    Compilation Succeeded with 0 Errors 1 Warning
    "out-dated function definition used"
    Clearly Visual Studio uses the C89 standard which we all know. The point I
    was getting at is compiler vendors are even trying to get function parameters
    and prototypes declared to the letter of the standard. This is like having an
    angry professor stood over your shoulder while you code...
    It's a great thing.
    Double Helix STL

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Return pointer to a vector of objects as a function return
    By Adaptron in forum C++ Programming
    Replies: 14
    Last Post: 04-07-2016, 09:23 AM
  2. Return 0; undeclared?
    By litzkrieg in forum C Programming
    Replies: 9
    Last Post: 01-23-2011, 10:19 PM
  3. Replies: 12
    Last Post: 04-07-2007, 11:11 AM
  4. cout undeclared/cin undeclared
    By akbigchillin in forum C++ Programming
    Replies: 6
    Last Post: 04-24-2006, 04:06 PM
  5. Replies: 6
    Last Post: 04-09-2006, 04:32 PM

Tags for this Thread