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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:03:42+00:00 2026-05-31T10:03:42+00:00

for(; max != 0 ; max/=10, pow10*=10) Pulled this exerpt from the wiki page

  • 0
for(; max != 0 ; max/=10, pow10*=10)

Pulled this exerpt from the wiki page on “Radix sort.” I’ve not seen a loop that starts with a semicolon like that before. The compiler didn’t catch it so I’m assuming it’s legal. Can anyone explain?

Also, as I’ve only written fairly simple loops I didn’t realize that you could make multiple assignments (right word?) like “max/=10, pow10*=10” at the end of the for() statement … Is there any limit to this? Bad form?

Thanks guys! (and pardon my potentially wrong vocabulary…it’s early, I need more coffee…)

  • 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-31T10:03:44+00:00Added an answer on May 31, 2026 at 10:03 am

    It is perfectly legal. This is a for loop with an empty initialization block.

    The most typical for loop looks something like this:

    for (int i = 0; i < size; i++) {
      ...
    }
    

    This is (almost) equivalent to the following:

    int i = 0;
    for ( ; i < size; ) {
      ...
      i++;
    }
    

    (Except that in the first case the scope of i is limited to within the loop, while in the second case, i is still visible after the loop, as its scope is the enclosing block.)

    For loops have three blocks, separated by semicolons: initialization, loop condition and loop increment. Any or all of these can be empty. So this is legal too (resulting in an endless loop):

    for(;;)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

select max(DELIVERY_TIMESTAMP) from DOCUMENTS; will return the time that the latest document was delivered.
SELECT MAX(some_field) FROM table_A GROUP BY another_field This only gets the max value of
select max(Key) from MyTable with(nolock) I have this T-SQL statement but need to use
select max(qtd) from (select count(int_re_usu) as qtd from tb_questionario_voar_resposta) Why this query dont work?
SELECT MAX(verification_id) FROM VERIFICATION_TABLE WHERE head = 687422 AND mbr = 23102 AND RTRIM(LTRIM(lname))
If I use max-device-width does that include landscape mode? Say I use it to
max($caption); gives me this: Array $caption is defined here: $i = 0; while ($i
For the query: SELECT MAX(LOG_CREATION_DATE),COL_A, COL_B FROM IMPORT_LOG GROUP BY TO_CHAR(LOG_CREATION_DATE, 'MM-DD-YYYY'), COL_A, COL_B
how can i get max Date and Min Date from a list Date Column
select max( sum(duration) ),cd from rent group by cd; . ERROR 1111 (HY000): Invalid

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.