这3行中至少有6个错误! time_t mytime = time(0); printf(" time:%s \ n",asctime(localtime(& mytime) ));; Jirka 非常感谢。 永远不要相信来自网络的例子:'' ) 没有kiddin''。什么是time()的原型?什么是asctime()?(注意, ascitime( )不存在......)特别是,这些函数需要什么样的参数? Richard Hi I need to print the current time. I found an example where this is done as followed:long *mytime;time(mytime);printf("time: %s", ascitime(mytime); But this doesn''t work and prints some ugly numbers. How is this done correctly? 解决方案 At least 6 errors in these 3 lines! time_t mytime = time(0);printf("time: %s\n", asctime(localtime(&mytime))); Jirka At least 6 errors in these 3 lines! time_t mytime = time(0); printf("time: %s\n", asctime(localtime(&mytime)));Jirka Thanks a lot.Never trust examples from the web :'') No kiddin''. What is time()''s prototype? What is asctime()''s? (And note,ascitime() doesn''t exist...) In particular, what kind of parameters dothese functions take? Richard 这篇关于当前时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 09-22 13:02