首页 > 解决方案 > 调用类的静态成员传递参数并获取返回值

问题描述

我有一个像下面这样带有静态函数的类

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++

解决方案


推荐阅读