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 8683813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:08:28+00:00 2026-06-12T22:08:28+00:00

I find that in a function return statement I am able to do this.

  • 0

I find that in a function return statement I am able to do this.

int f() {
    return 1;;;;;;;;;;;;;;;;;;;;;;;; // ...;;;
}

I can add as many semicolons as I want and the above doesn’t result in any compiler or runtime errors. This surprised me coming from a strict language like C++. Can someone explain why I am able to do this? I’m unable, however, to do this in any other context.

int x = 1;;;; // error

So can someone tell me why I am able to do something like this?

  • 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-12T22:08:30+00:00Added an answer on June 12, 2026 at 10:08 pm

    Quoted from K&R, expression statement has product expression-statement: expression;.

    If the expression is missing, the construction is called a null statement;
    it is often used to supply an empty body to an iteration statement to place
    a label.

    It is a valid language construct, so no complains from your compiler.

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

Sidebar

Related Questions

I can't seem to find a function that captures and returns a regex'ed string.
Problem <script type=text/javascript src=http://localhost/ci/js/global_functions.js></script> <script type=text/javascript src=http://localhost/ci/js/global.js></script> Why can't global.js find a function that
I could not find the function that returns the name of the cell referenced.
I have a quick question here. I know that the cakePHP find('first') function returns
I search the web alot and didn't find c++ function that replace xml Special
I search the web alot and didn't find js function that replace xml Special
When I wait on a non-signaled Event using the WaitForSingleObject function, I find that
yet I didnt find a jquery function that validate value to be a future
I'm trying to find/write a function that would perform the same operation as imlincomb
I'm trying to find a Delphi function that will split an input string into

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.