如何在c语言中转换以下数据类型 [英] how one can convert the following data type in c sharp

查看:103
本文介绍了如何在c语言中转换以下数据类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

THCAR * function();
这是dll中的功能,我必须在c sharp中调用它.

//采取的变量
字符串sz_name = string.Empty;

现在,我需要在c sharp中调用此函数,并在sz_name中收集值.转换应该如何完成.

THCAR * function() ;
This is the function in the dll which i have to call in c sharp .

// variable taken
string sz_name = string.Empty ;

Now i need to call this function in c sharp and collect the value in sz_name . How the conversion should be done .

推荐答案

通常的规则是,如果数据仅是单向执行(如您将数据传递给方法,但不要期望它会发生变化),请使用string对象.如果它用作out参数,请使用StringBuilder对象.
The general ruil is that if the data is only doing one-way (as in you''re passing the data into the method but not expecting it to change), use a string object. If it''s serving as an out parameter, use a StringBuilder object.


这篇关于如何在c语言中转换以下数据类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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