Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 840455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:37:32+00:00 2026-05-15T05:37:32+00:00

Possible Duplicate: Difference between void main and int main? Alright, so I’m using bloodshed

  • 0

Possible Duplicate:
Difference between void main and int main?

Alright, so I’m using bloodshed complier, first thing I should note is I’m using a
2001 edition C++ for the absolute beginner, was there any changes to C++ since 2001 that would effect the validity of this book? I ask because I know php has php5 and now php6 but I haven’t seen any C++03.

Now for the reason I asked that, in this code it uses,

void main (void)

why would I want an argument to be void? what does this do.

But when I run the void main (void) in my compiler it says that main must have a “int” before it. So I can’t have “void” main (void);

Also, once the code runs through, as long as there isn’t a “cin” the program closes.
Is this normal behavior, is there a better way to stop this besides making a cin at the end of my program?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T05:37:32+00:00Added an answer on May 15, 2026 at 5:37 am

    What there have been since 2001 are changes to C++ compilers, which on the whole are much pickier about how standards-conformant your C++ must be before they accept it. For example, gcc has gone from 2.95 or so all the way to 4.4.2. Earlier compilers may have let you slide with this form of main, as they would several old C-isms that are not proper C++, but it’s not the language that’s changed in this case (at least, as far as the standard goes).

    Having said that: yes, C++ has changed, and is changing, though not quite yet at the official standards level. Different compilers support those changes to different extents. I don’t think you’re likely to be impacted by them, but you may want to be aware of them at any rate. See:

    • C++ TR1
    • C++0x, the forthcoming standard

    As far as how to end your program. I recommend a simple “return 0;” at the point in main where you want to exit – or use an exit code other than 0 if you want to exit with an error. You can omit the return, though, and many examples do this, though I personally think it’s bad style.

    I understand you’re using cin to pause the application before it exits. This isn’t required for C++ apps in general, it’s just a convenience for running the app in the manner you are. It’s OK for examples, but you’d definitely want to avoid that for a real application.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 538k
  • Answers 538k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Yes, it is a bug. See this answer. Quoting CMS:… May 17, 2026 at 2:01 am
  • Editorial Team
    Editorial Team added an answer Have you tried putting the parameter names into a static… May 17, 2026 at 2:01 am
  • Editorial Team
    Editorial Team added an answer I'd say running your program from the console should work… May 17, 2026 at 2:01 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Possible Duplicate: Difference between pointer variable and reference variable in C++ When should I
Possible Duplicate: What is the difference between using a struct with two fields and
Possible Duplicate: What is the difference between a delegate and events? Possible Duplicate: Difference
Possible Duplicate: C#: Difference between ‘ += anEvent’ and ‘ += new EventHandler(anEvent)’ Hi
Possible Duplicate: C# newbie: what’s the difference between “bool” and “bool?” ? Hi, While
Possible Duplicate: Difference between -%> and %> in rails So for an ERB file,
Possible Duplicate: Difference between -%> and %> in rails I need to know what
Possible Duplicate: Difference between a Structure and a Union in C I see this
Possible Duplicate: Difference between lock(locker) and lock(variable_which_I_am_using) In all of the thread-safe code examples
Possible Duplicate: Difference between declaring variables before or in loop? Is there any (or

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.