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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:41:15+00:00 2026-06-15T18:41:15+00:00

How can I convert a variable of type var or var* to var& I’ve

  • 0

How can I convert a variable of type var or var* to var&

I’ve to use a function which takes an object of var class(suppose there’s a class). The example code was given like this:-

testFunc(false, namespace1::namespace2::var(), 100);

in function declaration it says that the second parameter is of type namespace1::namespace2::var&, I can create namespace1::namespace2::var or namespace1::namespace2::var*, but how do I create namespace1::namespace2::var&?

I know that’s too basic question but I couldn’t figure it out.

Edit:
I’ve tried using just var, but it gives some odd errors. I am pretty sure that’s some kind of fault in the function I am using. Here’re the errors:-

Error   3   error C2825: 'CType': must be a class or namespace when followed by '::'
Error   4   error C2039: 'TypeCode' : is not a member of '`global namespace''
Error   5   error C2146: syntax error : missing ',' before identifier 'TypeCode'
Error   6   error C2065: 'TypeCode' : undeclared identifier 
Error   7   error C3203: 'CustomType' : unspecialized class template can't be used as a template argument for template parameter 'Base', expected a real type   

Edit 2

I thought it’d be hard to answer if I include real code, since it’s complicated. But have a look if it helps. The real function’s signature is like this:-

virtual bool opRaiseEvent(bool reliable, const Common::Hashtable& parameters, nByte eventCode, nByte channelID=0, int* targetPlayers=NULL, short numTargetPlayers=NULL);

and the example code used the function like this:-

mLoadBalancingClient.opRaiseEvent(false, ExitGames::Common::Hashtable(), 100);

which was working fine. But now I want to add data to the HashTable, so I need to create an object of it and then pass it to the function. It’s not accepting a pointer or normal variable. I don’t know why it’s working with just HashTable().

  • 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-15T18:41:16+00:00Added an answer on June 15, 2026 at 6:41 pm

    This should work :

    const Common::Hashtable param = namespace1::namespace2::var();
    opRaiseEvent(false, param, 100);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have a variable of type Int = 08, how can I convert
How i can convert to c# code files to html files?Is there any generation
is there anyway that I can convert a png to a bmp in C#?
Is there any method provided by Apple or any technique that can convert a
How can I convert a variable name into a string ? Example: From this:
i have a jquery function which i want to convert to .live because i
how i can convert PWSTR variable to uppercase in vc++ . I googled but
Possible Duplicate: How can I code a C# function to accept a variable number
I am writing a debug function, which prints a variable name, and its value.
In SQL Server(T-SQL) you can convert a DateTime variable to a a decimal values

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.