标题:书上没说清楚,求指教错误
取消只看楼主
原味好
Rank: 4
来 自:西安
等 级:业余侠客
帖 子:59
专家分:250
注 册:2011-11-29
结帖率:80%
已结贴  问题点数:20 回复次数:0 
书上没说清楚,求指教错误
编程环境:visual c++ 6.0
两个文件为什么连不起来??
程序代码:
文件1
# include<iostream.h>
# include"tdate.h"

void main()
{
    Tdate s;
    s.Set(12/9/2011);
    someFunc(&s);
}
void someFunc(Tdate * pS)
{
    pS->Print();
    if (pS->IsLeapYear())
        cout<<"ohoh\n";
    else
        cout<<"right\n";
}
文件2
# include<iostream.h>
class Tdate
{
public:
    void Set(int m,int d,int y)
    {
        month=m;
        day=d;
        year=y;
    }
    int IsLeapYear()
    {
        return (year%4==0&&year%100!=0)||(year%400==0);
    }
    void Print()
    {
        cout<<month<<"/"<<day<<"/"<<year<<"\n";
    }
private:
    int month;
    int day;
    int year;
};   
错误提示:
C:\Users\Administrator\Desktop\c++\2.cpp(2) : fatal error C1083: Cannot open include file: 'tdate.h': No such file or directory
搜索更多相关主题的帖子: 编程 visual color 
2011-12-09 19:33



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-357396-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.633120 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved