从C ++到C#的指针 [英] Pointers from C++ to C#

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

问题描述

是否可以将C ++代码中的指针(例如int *)传递给C#代码(利用.NET中的通用语言功能)?还有用户定义的结构ptr(例如MyStruct *)吗?源代码可用于C ++和C#.

非常感谢.

Rajeswari

Can we pass a pointer (say int *) from C++ code to C# code (taking advantage of common language features in .NET)? And a user defined structure ptr (say, MyStruct*)? Source code is available for C++ as well as C#.

Many thanks.

Rajeswari

推荐答案

可以使用所谓的不安全代码.
指针初学者指南 [ http://programmingexamples.wikidot.com/differences-between-cpp-and-csharp [ ^ ]

另外,请检查google,因为与此有关的信息很多.

祝你好运!
You can, using so called unsafe code.
A Beginner''s Guide to Pointers[^]
http://programmingexamples.wikidot.com/differences-between-cpp-and-csharp[^]

Also, check google because there is a lot of information on this.

Good luck!


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

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