概述
使用指针作为参数的函数使用boost python的最佳方法是什么?
我看到文档中有很多返回值的可能性,但我不知道如何用参数来做.
void Tesuto::testp(std::string* s)
{
if (!s)
cout << " NULL s" << endl;
else
cout << s << endl;
}
>>> t.testp(None)
NULL s
>>>
>>> s='test'
>>> t.testp(s)
Traceback (most recent call last):
File "
std::string * pointer (std::string& p)
{
return &p;
}
>>> s = 'hello'
>>> t.testp (pointer (s))
hello
>>>
总结
以上是编程之家为你收集整理的用于提升python的指针参数全部内容,希望文章能够帮你解决用于提升python的指针参数所遇到的程序开发问题。
如果您也喜欢它,动动您的小指点个赞吧