ITPub博客

首页 > 应用开发 > > c++小问题

c++小问题

作者:soloxiao 时间:2019-08-20 11:27:42 0 删除 编辑

c++小问题 为啥 %%%% 注释掉 ##### 就显示不出来了 哪位大牛讲讲为啥 实在想不通

#include<iostream>
using namespace std;
class t
{
public:
    t(int m,int d,int y)
    {
    if(m>0&&m<13)
        month = m;
    if(d>1&&d<32)
        day = d;
    if(y>0&&y<3000)
        year = y;
    }
    ~t()
    {
    cout<<"#########################"<<endl;
    }
protected:
    int month;
    int day;
    int year;
};
void fn()
{
t *p;
p=new t(1,5,1998);
cout<<"%%%%%%%%%%%%%%5555"<<endl;
delete p;
}
int main()
{
    fn();
    return 0;
}


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/2079/viewspace-3154351/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-04-16

  • 博文量
    122
  • 访问量
    823