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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T21:16:03+00:00 2026-05-12T21:16:03+00:00

I have this kind of code: main() { for(i=0;i<100;i++) { if(cond1) func(1); //Just some

  • 0

I have this kind of code:

main()
{
   for(i=0;i<100;i++)
   {
   if(cond1)
       func(1); //Just some logics are present here
   if (cond2)
      if(cond3 | cond4)
          func(2);
and so on....
   }
}

void func(int)
{
   do somthing;
   if cond5
      continue;// this is for the FOR loop in main() & I know this doesnt make sense.
}

So, Depending on some IF condition in the function ‘func’, I want to ‘continue’ the FOR loop present in main(). How to achieve this?
Thanks in advance…

  • 1 1 Answer
  • 1 View
  • 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-12T21:16:03+00:00Added an answer on May 12, 2026 at 9:16 pm

    Return bool from your function and continue on false. Using your example:

    main()
    {
       for(i=0;i<100;i++)
       {
       if(cond1)
           func(1); //Just some logics are present here
       if (cond2)
          if(cond3 | cond4)
              if (!func(2))
                 continue;
    and so on....
       }
    }
    
    bool func(int)
    {
       do somthing;
       if cond5
          return false;
       return true
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this kind of code below, how can I bind the visibility of
I have a bunch of occurrences of this kind of boilerplate code in my
I'm trying to learn how QProcess works and have this kind of code: #include
I have this kind of html code : .content { background-color:#3C2B1B; overflow:auto;} .menu {
I have this kind of node in my xml document: <parent ...> <a .../>
I have this kind of setup : Overridden BaseRunserverCommand that adds another option (--token)
I have this kind of table, it has many rows and each row has
I used to have this kind of simple JSON data and I could successfully
guys i have arrays in which i have to match this kind of text
I know this kind of questions have been asked already many times before. The

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.