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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:15:33+00:00 2026-05-23T13:15:33+00:00

Does anyone see any syntax error on the following line? int a6[3][2]={{0,0},{0,0},{0,0}}; for (int

  • 0

Does anyone see any syntax error on the following line?

int a6[3][2]={{0,0},{0,0},{0,0}};
for (int c=0 ; c<3 ; for(int c2=0 ; c2<2 ; cout<<a6[c++][c2++])) ;

It gives the following syntax error:

error C2143: syntax error: missing ')' before 'for'
error C2059: syntax error: ')'
  • 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-23T13:15:34+00:00Added an answer on May 23, 2026 at 1:15 pm

    The for command is not an expression that you can use for the post-increment part of another for. Put it outside the control statements of the loop.

    The code gets more readable if you keep with the common convention on how to write a loop, i.e. the code controlling the loop inside the for statement and the work to be done after it:

    for (int c = 0; c < 3; c++) {
      for(int c2 = 0; c2 < 2; c2++) {
        cout << a6[c][c2];
      }
    }
    

    This also fixes the bug that you have in your code, i.e. that you are incrementing c for every value that you show, while you should only increment it for every second value that you show.

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

Sidebar

Related Questions

See here: http://code.google.com/p/ie7-js/ Does anyone have any experience or remarks about this javascript? Is
Does anyone see any issues with this basic test? var GC_MemoryStart = System.GC.GetTotalMemory(true); Stopwatch
Does anyone see a problem with this, its not working saying bad file descriptor
Does anyone have experience using the URL Rewrite Module (see here )? Can it
Does anyone know how I can check to see if a directory is writeable
Does anyone have metrics on the utility of formal Unit Testing? I see a
I see a lot of IoC frameworks for .Net and Java. Does anyone know
Does anyone have any recommendations of tools that can be of assistance with moving
Does anyone see anything wrong with what I am doing here? I haven't worked
Does anyone have any tips for debugging exceptions in a C# object initializer block?

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.