ref和在C ++ / CLI [英] ref and out in C++/CLI

查看:140
本文介绍了ref和在C ++ / CLI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道C ++ / CLI code

I know that the C++/CLI code

void foo(Bar^% x);

变换成

Void foo(ref Bar x);

什么是C ++ / CLI code,它成为

What is the C++/CLI code that becomes

Void foo(out Bar x);

推荐答案

您可以使用OutAttribute:

You can use the OutAttribute:

using namespace System::Runtime::InteropServices;    
void foo([Out] Bar^% x); 

这篇关于ref和在C ++ / CLI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆