有没有人有一个可以写入二进制文件的代码示例.还有可以读取二进制文件并输出到屏幕的代码.查看示例我可以写入文件ok但是当我尝试从文件中读取时它没有正确输出.
希望有人能提供帮助.我正在解决某人在很久以前写的"C代码"中的一个问题,并且他已经转移了.
该段代码输出特定文件的时间戳.代码在Windows上运行时工作正常,但是当它在Linux上运行时,它会错误地显示Year.这一年没有在linux上显示,它显示35222.有没有人知道这里有什么问题?
谢谢
Windows输出:
Source file: test.dtl, Created: Mon, 27 May, 2013 at 16:13:20
Run Code Online (Sandbox Code Playgroud)
Linux输出:
Source file: test.dtl, Created: Mon, 27 May, 35222 at 16:13:20
Run Code Online (Sandbox Code Playgroud)
C代码中的函数:
void SummaryReport ( report_t *report, char *dtlName)
{
LogEntry(L"SummaryReport entry\n");
int i;
wchar_t *rootStrType,*localStr,timeStr[48];
wchar_t fileBuff[64];
struct tm *timeVals;
timeVals = localtime (&logHdr.date);
wcsftime (timeStr,47,L"%a, %#d %b, %Y at %X",timeVals);
/* Print the header information */
DisplayReportFile (report);
ReportEntry (report,L" Filesystem Audit Summary Report\n\n");
ReportEntry (report,L"Source file: %s, Created: %ls\n\n",dtlName,timeStr);
ReportEntry (report,L"Server: %ls",srvrName);
… …
Run Code Online (Sandbox Code Playgroud) 我在我正在创建的新网站中使用谷歌地图v3,我希望能够将海洋颜色显示为白色或透明.我无法看到如何做到这一点,如果有人知道我会感谢你的帮助.
顺便说一句,谷歌地图是国家:爱尔兰