0

Hello all. I am trying to convert a c document to c++. I requires that i use the out word like this.

if (executeCommand("QUIT", out response))

is there and out for c, or a better way that i'm unaware of. Thanks all for your time. bye

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by ravenous
0

Hello all. I am trying to convert a c document to c++. I requires that i use the out word like this.

if (executeCommand("QUIT", out response))

is there and out for c, or a better way that i'm unaware of. Thanks all for your time. bye

Isn't out a C# thing, not C? Anyway, I think that you can just pass the variable by reference in C++ to achieve the same result:

bool executeCommand( const char* pszCommand, int& response );

...

int main()
{
   /* Some code */

   int iRespinseVal;
   if ( executeCommand( "QUIT", iResponseVal ) )
       /* iResponseVal has the value determined by the executeCommand function */
       /* Do things with the value */
  
   return 0;
}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.