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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:11:46+00:00 2026-06-06T05:11:46+00:00

I have a Deque that contains this kind of stucts. struct New_Array { array<array<int,4>,4>

  • 0

I have a Deque that contains this kind of stucts.

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

In this stuct 2 different arrays may have same value of h.

deque<New_Array> Mydeque;

I also know how many different h are in the deque(the value of steps). And how many stucts are in the deque(Mydeque.size()).

I need to print one array for each h. Starting from h=0 till h=steps (steps is a known int value). Each array that is going to be printed must be the closer to the end of the deque.

I tried something like this:

void foo(deque<New_Array> Mydeque, int steps)
 for(int i=0; i<steps; i++)
     {
        deque<New_Array>::iterator it;
        it = find(Mydeque.begin(),Mydeque.end(),i);
        PrintBoard(*it); // This if a function where you enter the New_Array struct 
                         // and it prints the array         
     }
}

The above gives me : error C2679: binary '==' : no operator found which takes a right-hand operand of type 'const bool' (or there is no acceptable conversion)

Or something like this:

void foo(deque<New_Array> Mydeque, int steps)
for(int i=0; i<steps; i++)
     {
        deque<New_Array>::iterator it;
        for(unsigned int j=0;j<Mydeque.size();j++)
            {
            it = find_if(Mydeque.begin(),Mydeque.end(),Mydeque[j].h==i);
            PrintBoard(*it);
            break;
            }           

     }

The above gives me: error C2064: term does not evaluate to a function taking 1 arguments

EDIT: The deque is not sorted. For each h an array should be printed. This array should be the one that is at this moment closer to the end of the deque.

  • 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-06T05:11:47+00:00Added an answer on June 6, 2026 at 5:11 am

    The solution is :

    void Find_Solution_Path(deque<New_Array> Mydeque, int steps)
    {
    for(int i=0; i<steps+1; i++)
        {
            for(int j=Mydeque.size()-1;j>-1;j--)
            {
                if (Mydeque[j].h==i)
                {
                    PrintBoard(Mydeque[j]);
                    cout<<endl;
                    break;
                }    
            }    
        }
    }
    
    • 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 std::arrays . I want to convert it to
Have data that has this kind of structure. Will be in ascending order by
Have data that has this kind of structure: $input = [ { animal: 'cat',
If I have a deque or list that's being manipulated on different threads, can
I have: void add_all_msgs(std::deque<Message>::iterator &iter); How can I make that function generic, so it
I wrote a class (let's call it Model.java) that contains a Deque<T> , with
Consider this piece of code: Uint counter = 0; int* p1; int* p2; deque<int>
I have a class that i want to push_back into a deque. The problem
I have a std::deque, and I want to insert an element at a specified
have a php code like this,going to convert it in to C#. function isValid($n){

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.