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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:42:16+00:00 2026-06-07T06:42:16+00:00

I am new to C++ (from C# background) and I have a function with

  • 0

I am new to C++ (from C# background) and I have a function with the following signature

 void AddBenchNode(ref_ptr<Group> root ,ref_ptr<Node> benches, bool setAttitude = false, float scale_x =.15, float scale_y =15, float scale_z = 15, int positionx = 250, int positiony = 100, int positionz =0 )
{

}

But when I try to call the code as below, I get an error which says function does not take 4 arguments.

//then I try to call my function like so
AddBenchNode(root, benches, false, 250);

but I instead get the following error message

error C2660: ‘AddBenchNode’ : function does not take 3 arguments

Would appreciate an explanation of how C++ does this instead?

  • 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-07T06:42:19+00:00Added an answer on June 7, 2026 at 6:42 am

    Check the prototype in your .hpp file. It’s probably declared as

    void AddBenchNode(ref_ptr<Group> root ,ref_ptr<Node> benches, bool setAttitude, 
                      float scale_x, float scale_y, float scale_z, int positionx, 
                      int positiony, int positionz);
    

    EDIT: The prototype in the header should be

    void AddBenchNode(ref_ptr<Group> root ,ref_ptr<Node> benches, bool setAttitude = false, float scale_x =.15, float scale_y =15, float scale_z = 15, int positionx = 250, int positiony = 100, int positionz =0 );
    

    And your cpp file should then only have

    void AddBenchNode(ref_ptr<Group> root ,ref_ptr<Node> benches, bool setAttitude, float scale_x, float scale_y, float scale_z, int positionx, int positiony, int positionz)
    {
    
    }
    

    That is, the default parameters are in the prototype, not in the actual definition.

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

Sidebar

Related Questions

I am developer from java background , new to ruby on rails. What's my
I'm new to C# coming from a python background. I've had a hard time
I am from procedure programming background, end up writing TSQL recently with my new
I'm new to PHP but come from a Java background and I'm trying to
I'm very new to Python (I'm coming from a JAVA background) and I'm wondering
I am relatively new to Objective-C and I am coming from a Java background,
I'm new to Python, coming from a C# background and I'm trying to get
I'm coming from a MS SQL Server background. Working on a new project using
Disclaimer: completely new to Python from a PHP background Ok I'm using Python on
Background: I have a function in my program that takes a set of points

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.