C#ref指针搞糊涂了 [英] C# ref pointer confused

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

问题描述

对不起要问一个新的问题..



目前我正在使用第三方成像处理图像处理程序(用c#编写)图书馆。我正处于想要从图像缓冲区获取数据的地方。



我正在调用成像库的功能来获取< br $>




functioncall(adressplz,ref address);





ok,现在我通过引用获得了地址。



指针如何指向此地址,并从中获取值? div class =h2_lin>解决方案

 functioncall(adressplz,ref address); 





这只是意味着参数地址通过引用传递,也就是说它可以被被调用的函数改变。请参阅文档 [ ^ ]了解详情。


sorry for asking maybe a newbish question..

currently i''m working on a image processing program (written in c#), using an 3rd party imaging library. I''m at a point where i want to get data from an imagebuffer.

i''m calling a function of the imaging library to get an andress by


functioncall(adressplz, ref address);


ok, now i got the address by reference.

How can a pointer point at this address, and get the value back from it ??

解决方案

functioncall(adressplz, ref address);



That simply means that parameter address is passed by reference, that is it may be changed by the called function. See the documentation[^] for details.


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

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