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

  • SEARCH
  • Home
  • 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 8447921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:17:46+00:00 2026-06-10T10:17:46+00:00

Possible Duplicate: Standard way to define parameter-less function main() in C Can I use

  • 0

Possible Duplicate:
Standard way to define parameter-less function main() in C

Can I use a declaration definition of function main() in C that looks like:

int main() {}

Yes, I saw that standard says that there are only two guaranteed-supported versions:

int main(void) {}

and

int main(int argc, char* argv[]) {}

But what about empty paratheses? I know that it has another meaning than in C++ (in C, it means that number and types of parameters of this function isn’t known), but I saw really much code in C with this declaration definition of main.

So who’s wrong?

  • 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-06-10T10:17:47+00:00Added an answer on June 10, 2026 at 10:17 am

    In C, there’s a difference between the declarations int main(); and int main(void); (the former declares a function with an unspecified number of arguments, and the latter is actually called a proto­type). However, in the function definition, both main() and main(void) define a function that takes no arguments.

    The other signature, main(int, char**), is an alternative form. Conforming implementations must accept either form, but may also accept other implementation-defined signatures for main(). Any given program may of course only contain one single function called main.

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

Sidebar

Related Questions

Possible Duplicate: Is there a standard date/time format that can be passed on a
Possible Duplicate: Standard way to remove multiple elements from a dataframe I know in
Possible Duplicate: Standard URL encode function? I need to transofrm a Delphi string (like
Possible Duplicate: Is it considered bad practice to use non-standard HTML attributes? Hi folks,
Possible Duplicate: Standard way to detect mobile browsers in a web application based on
Possible Duplicate: How do I trim leading/trailing whitespace in a standard way? I need
Possible Duplicate: Disable browser ‘Save Password’ functionality Is there a standard way to prevent
Possible Duplicate: does c++ standard prohibit the void main() prototype? Why is C++ not
Possible Duplicate: Does reading from stdin flush stdout? C++ Standard guarantees that all data
Possible Duplicate: Where is the c++11 standard I am looking to buy/download a few

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.