簡體   English   中英

Win32控制台項目問題

[英]Win32 Console Project issue

我用VS2010創建了一個Win32 Console項目(禁用“預編譯頭”選項)。

然后我按如下所示填充代碼

#include <stdio.h>
int main (void) {
    double d = 0x0.3p10;
    printf ("%.f\n", d);
    return 0;
}

編譯器在double d = 0x0.3p10;的行上顯示語法錯誤double d = 0x0.3p10;

: error C2059: syntax error : 'bad suffix on number'
: error C2143: syntax error : missing ';' before 'constant'
: error C2146: syntax error : missing ';' before identifier 'p10'
: error C2065: 'p10' : undeclared identifier

我的項目配置有問題嗎?

否。MicrosoftVisual C ++不支持ISO C99。 抱歉。 除使用其他編譯器外,沒有其他解決方法。 請參閱此問題的可接受答案

備擇方案:

  1. 可以與MSVC標頭一起使用的Clang 我認為還沒有可用的二進制文件,除非您喜歡編譯編譯器...
  2. mingw帶有msys和w32api的一套完整的標頭。
  3. 英特爾的編譯器套件 它與Visual Studio集成在一起,但並非免費。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM