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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:26:49+00:00 2026-06-01T06:26:49+00:00

I have a deque that contains std::arrays . I want to convert it to

  • 0

I have a deque that contains std::arrays .

I want to convert it to deque that contains structs.
The struct I made is like this :

struct New_Array {
array<array<int,4>,4> tablee;
int h;
} Jim;

And I have a deque that is named visited:

deque<New_Array> visited;

I have a function like that prints the array named PrintBoard.

    void PrintBoard(New_Array tt) {
        using namespace std;
        for (int iRow = 0; iRow < 4; ++iRow) {
            for (int iCol = 0; iCol < 4; ++iCol) {
                cout << tt.tablee[iRow][iCol];
                cout << "  ";//This space helps so the numbers can be visable 
            //to the user 
}
            cout << endl;
        }

}

When I write PrintBoard(visited.front()); it gives me error C2664: 'PrintBoard cannot convert parameter 1 from 'New_Array' to std:tr1::array<_Ty,Size>'.

What is the problem? I never used tables as one-dimension.

EDIT:

 #include <deque>
    #include <vector>
    #include <array>

    using namespace std;

    struct New_Array {
        array<array<int,4>,4> tablee;
        int h;
    }str_test,Jim;

    deque<New_Array> visited;

    void dfs()
    {
    PrintBoard(visited.front());//****the error is in this line****
    }

    void PrintBoard(New_Array tt) {
            using namespace std;
            for (int iRow = 0; iRow < 4; ++iRow) {
                for (int iCol = 0; iCol < 4; ++iCol) {
                    cout << tt.tablee[iRow][iCol];
                    cout << "  ";//This space helps so the numbers can be visable 
                //to the user 
            }
                cout << endl;
            }

            }

    int main() 
    {
        dfs();
        char test_char;
        cin>> test_char;
        return EXIT_SUCCESS;
    }
  • 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-01T06:26:51+00:00Added an answer on June 1, 2026 at 6:26 am

    The declaration of PrintBoard in your example is after where it is used in dfs(). If this is the way your code is structured, then you may have another PrintBoard declaration earlier that takes an array as an argument. It is likely that you have an old declaration in there somewhere that is being pulled in by your includes.

    Try moving the declaration of PrintBoard before its use.

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

Sidebar

Related Questions

I have a Deque that contains this kind of stucts. struct New_Array { array<array<int,4>,4>
I have: void add_all_msgs(std::deque<Message>::iterator &iter); How can I make that function generic, so it
I have a std::deque, and I want to insert an element at a specified
Lets say I have a structure struct s { std::deque<Object> q; //won't work with
I have a class that i want to push_back into a deque. The problem
If I have a deque or list that's being manipulated on different threads, can
I wrote a class (let's call it Model.java) that contains a Deque<T> , with
Problem I have a template container MyContainer<std::unique_ptr<Foo>> which has a std::deque<T> and a std::vector<T>
I have a very large list of items (~2 millions) that I want to
I have a deque type list (a queue) which I'd like to show and

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.