Thread: Local variable not initialized

  1. #16
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    Well, the main() argument gets even better if you consider C++. The only prototype for main() that is compliant with C89, C99, and C++ is this or a variation of it:

    Code:
    int main(int argc, char *argv[]);
    I know there are a bunch of C users that say that are of the opinion that they never will switch to a C++ compiler, so whatever.

  2. #17
    Registered User
    Join Date
    Sep 2006
    Posts
    835
    I know that for
    Code:
    int main(void)
    the "void" isn't necessary in C++, but I don't think there's anything noncompliant about it either, it's just an eyesore.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Local variable Question
    By WDT in forum C# Programming
    Replies: 2
    Last Post: 04-02-2009, 05:39 PM
  2. Should "static" variable always be local to a file?
    By meili100 in forum C++ Programming
    Replies: 3
    Last Post: 06-22-2008, 11:51 PM
  3. Folding@Home Cboard team?
    By jverkoey in forum A Brief History of Cprogramming.com
    Replies: 398
    Last Post: 10-11-2005, 08:44 AM
  4. Printing part of a local variable
    By Phan in forum C Programming
    Replies: 10
    Last Post: 09-26-2005, 05:51 PM
  5. return local variable
    By sangi in forum C Programming
    Replies: 17
    Last Post: 10-22-2004, 03:40 AM