Bcily 发表于 2021-8-7 15:09

疯狂报错,大神帮帮

c++新手,下面这段代码疯狂报错

#include<iostream>
using namespace std;
class test
{
    private:
   
      int math;
      int chinese;
      int english;
      float chemistry;
   
    public:
   
      void get((float) sub);
      ~test();
      test();
   
}
test::test()
{
    math=140;
    chinese=120;
    english=130;
    chemistry=40;
}
test::~test()
{
    cout<<"Get over!";
}
void test::get((float)sub)
{
    cout<<sub;
}
int main()
{
    {
      char*a;
      cout<<"Key the subject you want to know\n";
      cin>>a;
      cout<<"I know you want to know the grade of English\n";
      get(english);
    }
    return 0;
}
页: [1]
查看完整版本: 疯狂报错,大神帮帮