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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:50:59+00:00 2026-05-21T07:50:59+00:00

I have the following 2 functions in my code: bool num() { return 0;

  • 0

I have the following 2 functions in my code:

bool num()
{
    return 0;
}

void setDFS()
{
    int i = 0;
    project3::Graph<string, string> g1;

    std::for_each(g1.Vertice1.begin(), g1.Vertice1.end(),num);

}

What the function does is for each Vertice in vector Vertice1, it has to set its number to 0 for now. Once I start graph traversing, later on I would be incrementing the num to the traversed count.

While compiling, I am getting ”
error C2197: ‘bool (__cdecl *)(void)’ : too many arguments for call” error.

template <class VertexType, class EdgeType> class Vertex{
protected:
    VertexType vertice;
    EdgeType edge;

public:

};

std::vector<project3::Vertex<VertexType, EdgeType>*> Vertice1;
  • 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-21T07:50:59+00:00Added an answer on May 21, 2026 at 7:50 am

    for_each algorithm receives a unary function which should have the following signature:

    void function(T&);
    

    where T is the type of element of g1.Vertice1 vector:

    template <class VertexType, class EdgeType>
    void num(project3::Vertex<VertexType, EdgeType>* v) {
      *v = 0; // <- Maybe v->set(0,0,0)
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: Some functions: A::A(int i_a) {cout<<int Ctor\n;} //conversion constructor void
I have the following code: public void SetMove(Position3D pos, float time, float linearity, bool
i have following code #include <iostream> #include <utility> using namespace std; namespace rel_ops{ template<class
I have the following function: public void RestoreDatabase(String databaseName, String backUpFile, String serverName, String
I have the following function in my jQuery code: function checkUNSelectBox(item){ $('#DELETE option').each(function(){ <!--alert(item);-->
I have the following code: function isValidAuthor($authorID){ $query = SELECT * FROM jos_users WHERE
I have the following code: function build_all_combinations(input_array){ array = [1,2,3] limit = array.length -
I have the following code: function Person(){ this.age = 30; } function Stats(){ this.age
I have the following code function generate_pdf() { $fdf_data_strings = $this->get_hash_for_pdf(); #$fdf_data_names = array('49a'
I have the following code: function toggleChecked(status) { $(.checkbox).each( function() { $(this).attr(checked,status); }) }

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.