在"e-s"中找不到"operator"的匹配项 [英] no match for 'operator'- in 'e-s'
本文介绍了在"e-s"中找不到"operator"的匹配项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
#include<stdio.h>
#include<conio.h>
#include<windows.h>
int main(){
LARGE_INTEGER frequency;
LARGE_INTEGER e,s,diff;
QueryPerformanceCounter(&s);
for(int i=0;i<100;i++)
{}
QueryPerformanceCounter(&e);
diff=(e-s)/frequency*1000;
unsigned int milliseconds = (unsigned int)(diff & 0xffffffff);
printf("%u",milliseconds);
getch();
return 0;
}
我正在尝试执行此程序,但收到错误消息
在"e-s"中不匹配"operator"-
谁能帮我这个忙.在此先感谢...
i am trying to execute this program im getting an error as
no match for ''operator''- in ''e-s''
can anyone help me out with this. Thank in prior...
推荐答案
LARGE_INTEGER是一个联合,并且未定义-"运算符.使用QuadPart成员(如e.QuadPart-s.QuadPart中一样)或使用__int64.
LARGE_INTEGER is a union and doesn''t define the "-" operator. Use the QuadPart member (as in e.QuadPart-s.QuadPart) or use __int64 instead.
这篇关于在"e-s"中找不到"operator"的匹配项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文