C++ 定位错误行

char buf[MAX_PATH * 4] = {0};
        SYSTEMTIME st;
        GetLocalTime(&st);
        sprintf_s(buf, sizeof(buf) - 1, "%02d-%02d-%02d %02d:%02d:%02d | MyFace_RGB24ToRGB8 Error (%s: %d)", st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond, __FILE__, __LINE__);
        FILE* fp = fopen(g_SysArgsSet.m_logFile, "a+");
        fwrite(buf, strlen(buf), 1, fp);
        fclose(fp);
        fp = NULL;

 

posted @ 2016-03-28 14:58  QQ76211822  阅读(656)  评论(0编辑  收藏  举报