V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
fftao
V2EX  ›  问与答

为什么这里显示函数调用缺少参数列表??

  •  
  •   fftao · 2014-12-26 20:09:28 +08:00 · 2874 次点击
    这是一个创建于 3403 天前的主题,其中的信息可能已经有所发展或是发生改变。
    #include <iostream>
    using namespace std;
    class Student
    {
    private:
    char *name;
    float english, math, chinese;
    public:
    Student(char *n, float e, float m, float c)
    {
    name = n; english = e; math = m; chinese = c;
    }
    void showname()
    {
    cout << name << " ";
    }
    float avg()
    {
    cout << (english + math + chinese) / 3;
    }
    };
    void main()
    {
    Student std[3] = {
    Student("li", 77, 88, 99),
    Student("chen", 78, 89, 90),
    Student("wu", 87, 97, 67)
    };
    for (int i = 0; i < 3; i++)
    {
    std[i].showname;
    std[i].avg;
    }
    }
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2735 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 12:44 · PVG 20:44 · LAX 05:44 · JFK 08:44
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.