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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:19:15+00:00 2026-06-16T00:19:15+00:00

Possible Duplicate: Function argument type followed by *& I am looking at someone else’s

  • 0

Possible Duplicate:
Function argument type followed by *&

I am looking at someone else’s code right now and saw an unusual (atleast for me) function declaration syntax. Is the following valid C++ syntax?

bool Foo::Bar(Frame *&ptoframe, int msToBlock)
{
    ....
}

I think the developer is trying to declare a pointer to a reference.

thanks for the help

  • 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-16T00:19:16+00:00Added an answer on June 16, 2026 at 12:19 am

    Yes, it’s valid. Read the syntax from right to left: it’s read reference to a pointer. This is important if you wish to change the pointer being passed to the function. The pointer is effectively passed by reference just like any other parameter.

    Here’s a pretty example:

    void no_change(int * ptr) {
        ptr = 0;
    }
    
    void change_ptr(int *& ptr) {
        ptr = 0;
    }
    
    int main() {
    
        int *x;
    
        change_ptr(x);
    
    }
    

    The value of any pointer passed to change_ptr will be changed because we are passing it by reference.

    Note, however that the value of the object to which a pointer points can still be changed through the no_change function (i.e *ptr = new int). This syntax is applying only to the actual pointer, not its pointed-to object.

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

Sidebar

Related Questions

Possible Duplicate: calling ASP function from javascript okay running this code : <script type=text/javascript>
Possible Duplicate: c++ virtual function return type I have a simple but confusing question
Possible Duplicate: open-ended function arguments with TypeScript Is there any acceptable type signature for
Possible Duplicate: trailing return type using decltype with a variadic template function I want
Possible Duplicate: trailing return type using decltype with a variadic template function I'm getting
Possible Duplicate: How can the built-in range function take a single argument or three?
Possible Duplicate: [PHP/JavaScript]: Call PHP file through JavaScript code with argument Ok so I
Possible Duplicate: Template deduction for function based on its return type? I am trying
Possible Duplicate: How to pass and call a function as an argument in Javascript?
Possible Duplicate: default method argument with class property? I'm writing a recursive function 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.