Thread: GetLogicalDriveStrings() problem

  1. #16
    MFC killed my cat! manutd's Avatar
    Join Date
    Sep 2006
    Location
    Boston, Massachusetts
    Posts
    870
    The standard states that main() should return an int, so main() should return an int.
    Silence is better than unmeaning words.
    - Pythagoras
    My blog

  2. #17
    Registered User
    Join Date
    Oct 2005
    Posts
    35
    well, finally it's clear for me! standard says that - and i'll follow this rule!
    im from LMoldovaZ

  3. #18
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Quote Originally Posted by LMZ
    well, finally it's clear for me! standard says that - and i'll follow this rule!
    main returns int in any case even if you don't put return statement in it.
    when you declare function one way, and actually it is defined another way - you mess with the stack.
    (You say that the main is void - notifying the compiler that the function does not put return value to the stack... Actually main puts something to the stack...)

    Messing with the stack has unpredictable results.
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  4. #19
    Registered User
    Join Date
    Oct 2005
    Posts
    35
    2 vart:
    Know I absolutely understood why I shouldn't use main as void. Thank you so much!
    im from LMoldovaZ

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help understanding a problem
    By dnguyen1022 in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2009, 04:21 PM
  2. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  3. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM