-3
MS Visual Studio 2012(cl.exe命令行編譯器)。爲什麼我得到一個錯誤(閱讀評論)?爲什麼我得到C2059錯誤?
// C89
#include<ctype.h>
#include<time.h>
int main(void){
long int i;
long int n = 1000;
clock_t cur_time1 = clock();
clock_t cur_time2;
long double secs;
for(i = 0; i < n; ++i);
cur_time2 = clock();
// Here I get an error C2059
secs = long double(cur_time2 - cur_time1)/long double(CLOCKS_PER_SEC);
printf("For the thousand: %lf sec.\nFor the billion: %lf sec.\n",
secs, secs * 1000000);
getchar();
}
謝謝。
什麼是這個錯誤的描述?我們不記得所有的錯誤代碼.. –
@Kiril Kirov http://msdn.microsoft.com/en-us/library/t8xe60cf.aspx –
'(long double)' – BLUEPIXY