?:想输出时间
请教各位老师,我的需求在以下程序的注释中。谢谢先
#include "stdafx.h"
#include "stdio.h"
#include "time.h"//?vc6 console中时间库是这么?不是又是什么?
time_t time_addition(volatile const struct timer *t,int a)
{
int n;
int x;
time_t then;
x=0
then=t->value;/*t->value是硬件计数器,其值随时间增加, VOLATILE是防止其被编译器优化*/
for(n=0;n<1000;n++)
{
x=x+n;
}
return t->value-then;
}
void main(int argc, char* argv[])
{
time_t now; //?如何在console环境中得到当前时间作为参数给time_additon函数?
now=getlocaltime();//?
//想在此输出当前时间
time_addition(now,100);//?
//想在此输出改变后的时间
}