GetLogicalDriveStrings() problem

This is a discussion on GetLogicalDriveStrings() problem within the Windows Programming forums, part of the Platform Specific Boards category; The standard states that main() should return an int, so main() should return an int....

  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
    LMZ
    LMZ is offline
    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
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,484
    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.
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  4. #19
    LMZ
    LMZ is offline
    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

Page 2 of 2 FirstFirst 12
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, 10: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21