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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:25:44+00:00 2026-05-25T19:25:44+00:00

I have a 49 space one dimensional array declared as int boardArray [49]; and

  • 0

I have a 49 space one dimensional array declared as int boardArray [49]; and I also have a two dimensional 7×7 array declared as int boardArrayTwo [7][7]' I am trying to use nested for loops to throw the one dimensional array into the two dimensional array here is the code I am using to test it.

for (int i = 0; i > 50; ++i)
{
    boardArray[i] = i; //fills the array with ints 0 - 48 to test
}
for (int x = 0; x >= 7; ++x)
{
    for (int k = 0; k >= 7; ++k)
    {
        for (int n = 0; n >= 49; ++n)
        {
            boardArrayTwo[x][k] = boardArray[n];
            cout << boardArrayTwo[x][k] << " " << endl;
        }

    }
}

I tried running this but nothing happens. Am I doing it 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-05-25T19:25:44+00:00Added an answer on May 25, 2026 at 7:25 pm
    for (int x = 0; x >= 7; ++x)
    {
        for (int k = 0; k >= 7; ++k){
             for (int n = 0; n >= 49; ++n)
        {
    

    this is wrong. x and k should be < 7 (and the third cycle shouldn’t be used) :

    for (int x = 0; x < 7; ++x)
    {
        for (int k = 0; k < 7; ++k){
            boardArrayTwo[x][k] = boardArray[7*x + k];
    

    EDIT:

    like @Fabio Ceconello make me notice in his comment, even the first loop is wrong because of the inverted condition checks, it should be modified this way:

    for (int i = 0; i < 49; ++i)
    {
        boardArray[i] = i; //fills the array with ints 0 - 48 to test
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two vectors defining two separate points in a three-dimensional space. One is
New Programmer here. Trying space invaders. I have a 2 dimensional array of objects
Quick one. I'm using mod rewrite and have most replacements in place: empty space
i have two points in 3D space which have X-coordinates with different signum. so
I have a UILabel with space for two lines of text. Sometimes, when the
I have two 2d circles in 3d space (defined by a center, normal, and
I have two points in 3D space: a = (ax, ay, az) b =
In a multi-dimensional space, I have a collection of rectangles, all of which are
In C++ you can easily allocate one dimensional array like this: T *array=new T[N];
I have a three dimensional array which I want to fill in with values

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.