【发布时间】:2019-03-18 13:35:30
【问题描述】:
我正在使用 c 语言,我们现在的课程是关于结构的。这是我的代码的一部分,“temp”是一个结构,其中也有一个日期结构。但是,在某些情况下,某些有效日期直到最后一个条件才能进入。
if( temp.Date.year >= start.year && temp.Date.year <= end.year)
if( (temp.Date.year >= start.year && temp.Date.year <= end.year) && (temp.Date.month >= start.month && temp.Date.month <= end.month) )
if( (temp.Date.year >= start.year && temp.Date.year <= end.year) && (temp.Date.month >= start.month && temp.Date.month <= end.month) && temp.Date.day >= start.day && temp.Date.day <= end.day)
isDateValid = 1;
【问题讨论】:
-
"在某些情况下,某些有效日期直到最后一个条件才能进入" --> 发布这些情况比仅说某些情况存在更能提供信息。发布麻烦案例的价值会增加问题的价值。
标签: c date dateinterval