c++ - 调用类的静态成员传递参数并获取返回值
问题描述
我有一个像下面这样带有静态函数的类
class Car: public Vehicle
{
public:
static int b;
Car(int x)
{
cout<<"This is Car"<<x<<endl;
}
static char* x1(int x)
{
b=x;
return (char*)"done";
}
}
我喜欢调用x1
静态函数并传递值并获取返回值。怎么做?
解决方案
推荐阅读
- c# - Service Bus Queue的多个客户中的取消令牌处理
- php - 仅需要具有 composer 的特定服务器的包
- java - java.lang.IllegalStateException:应为 BEGIN_ARRAY,但在使用 Gson 库时为 STRING
- java - 当我在数组中有参数时如何发送发布请求?
- android - 游戏中的 onTouchEvent()
- c# - 检查 null 后的 null 引用异常(检查 null 不起作用)
- html - 更改网格模板列会破坏布局
- javascript - reactjs的render方法中如何使用三元运算符?
- arrays - 快速分组建模数组数据
- python - Django get_absolute_url() 将用户返回到主页