- 论坛徽章:
- 0
|
#include <stdio.h>;
#include <time.h>;
int main()
{
struct tm tn;
time_t tt;
time(&tt);
tn = localtime(&tt);
printf("%04d%02d%02d\n", tn->;tm_year+1900,tn->;tm_mon+1,tn->;tm_mday);
return 0;
}
编译时报错:
CC(大CC) test_tm.cpp
"test_tm.cpp", line 10: Warning (Anachronism): Assigning std::tm* to std::tm.
"test_tm.cpp", line 10: Error: Cannot cast from std::tm* to std::tm.
"test_tm.cpp", line 12: Error: Pointer type needed instead of std::tm.
"test_tm.cpp", line 12: Error: Pointer type needed instead of std::tm.
"test_tm.cpp", line 12: Error: Pointer type needed instead of std::tm.
4 Error(s) and 1 Warning(s) detected.
请高手指点!!! |
|