Thread: how to solve this bug??

  1. #31
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by transgalactic2
    i understood that void main() is perfectly ok in C
    Read carefully: void main() is legal if your compiler documents it as an option, and only because of a defect in the standard. Consequently, it is non-portable, because it is not required, though also not forbidden.

    However, the difference between int main() and void main() is so minimal that there is really no reason to use void main() even when it is allowed, unless you are required to do so by some person in charge of your marks or your pay who you cannot convince otherwise. In that case, be pragmatic: use void main(), but know that you should not do so otherwise.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  2. #32
    Banned
    Join Date
    Oct 2008
    Posts
    1,535
    thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. gaks bug?
    By Yarin in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 08-31-2008, 02:47 PM
  2. Debugging a rare / unreproducible bug..
    By g4j31a5 in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 08-05-2008, 12:56 PM
  3. ATL bug of CComPtr?
    By George2 in forum Windows Programming
    Replies: 6
    Last Post: 04-07-2008, 07:52 AM
  4. Annoying bug I can't find or fix!
    By homeyg in forum C++ Programming
    Replies: 3
    Last Post: 11-21-2004, 12:13 AM
  5. Recource Script Bug in VC++
    By Xzyx987X in forum Windows Programming
    Replies: 1
    Last Post: 04-24-2004, 09:19 PM