Chinaunix

标题: 请教,关于SOLARIS 8下的C++时间编译问题 [打印本页]

作者: chq798    时间: 2004-06-28 21:00
标题: 请教,关于SOLARIS 8下的C++时间编译问题
#include <stdio.h>;\r\n#include <time.h>;\r\n\r\nint main()\r\n{\r\n        struct tm tn;\r\n        time_t tt;\r\n        \r\n        time(&tt);\r\n        tn = localtime(&tt);\r\n        \r\n        printf(\"%04d%02d%02d\\n\", tn->;tm_year+1900,tn->;tm_mon+1,tn->;tm_mday);\r\n        return 0;\r\n}\r\n\r\n编译时报错:\r\n CC(大CC) test_tm.cpp\r\n\"test_tm.cpp\", line 10: Warning (Anachronism): Assigning std::tm* to std::tm.\r\n\"test_tm.cpp\", line 10: Error: Cannot cast from std::tm* to std::tm.\r\n\"test_tm.cpp\", line 12: Error: Pointer type needed instead of std::tm.\r\n\"test_tm.cpp\", line 12: Error: Pointer type needed instead of std::tm.\r\n\"test_tm.cpp\", line 12: Error: Pointer type needed instead of std::tm.\r\n4 Error(s) and 1 Warning(s) detected.\r\n\r\n请高手指点!!!




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2