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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:28:31+00:00 2026-06-13T19:28:31+00:00

I have a function declared something like void func1(int& x) { func2(x); // func2

  • 0

I have a function declared something like

void func1(int& x) {
    func2(x); // func2 accepts an int
}

I think this is what crashes the program? I get the error

R6010 - abort() has been called

What do I need to do to pass x into a function that accepts an int? I expected them to work the same … since I can just echo the value of x using cout << x

UPDATE

Just a test:

cout << stmtNo << endl;
Node* n = ast->getNode(stmtNo);
cout << n->getNodeType() << " " << n->getStmtNo() << endl;

Above fails … Below passes

cout << stmtNo << endl;
Node* n = ast->getNode(1);
cout << n->getNodeType() << " " << n->getStmtNo() << endl;
  • 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-13T19:28:34+00:00Added an answer on June 13, 2026 at 7:28 pm

    There is no problem, you can always pass an integer reference as an argument for an integer.

    Integer references can be interpreted as constant pointers who automatically de-reference themselves.

    #include<iostream>
    using namespace std;
    void fun_2(int s)
    {
       cout<<s<<endl;
    }
    void func(int &d)
    {
        fun_2(d);
    }
    
    int main()
    {
       int x=99;
       func(x);
    
       system("pause");
       return 0;
    }
    

    The above code works perfectly!

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

Sidebar

Related Questions

I have a function like this: private void GetRSS(int start, int end) { for
I have written my own function, which in C would be declared like this,
Suppose I have a function in a single threaded program that looks like this
I have a variable declared at the top of my function as this.current_test =
Suppose I have code something like this: #include boost/thread/mutex.hpp using boost::mutex; typedef mutex::scoped_lock lock;
I have a class declared like this in a header file : class COMPLEX{
If I have a prototype that is declared as: void foo(int (*fi)(void *, void
I have an Action delegate declared like this. private readonly Action<List<PSDPoint>[]> _psdAction; _psdAction =
I have a fixed-size array declared: int vals[25]; And I'd like to send the
I have a function X() declared as PURE VIRTUAL in base class: class Base

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.