a513155803 2019-03-27 18:29 采纳率: 100%
浏览 223
已采纳

C++/CLR中精确到毫秒的问题

使用C++/CLR写的话报错了,这是这么回事

#include <stdio.h>
#include <sys/timeb.h>
#include <winsock2.h>
#include <iostream>
#include "stdafx.h"
using namespace std;

void main()
{
    struct timeb tb;
    ftime(&tb);
    cout << tb.time * 1000 + tb.millitm << endl;
    system("pause");
}

图片说明

  • 写回答

1条回答 默认 最新

  • a513155803 2019-03-27 18:41
    关注

    将#include "stdafx.h"移到第一行就行了

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?