【发布时间】:2014-05-24 08:36:34
【问题描述】:
http://blogs.msdn.com/b/vcblog/archive/2013/07/19/c99-library-support-in-visual-studio-2013.aspx
C99 支持添加了 Visual Studio 2013,但我无法在“C”代码中使用 complex.h。
#include <stdio.h>
#include <complex.h>
int main(void)
{
double complex dc1 = 3 + 2 * I;
double complex dc2 = 4 + 5 * I;
double complex result;
result = dc1 + dc2;
printf(" ??? \n", result);
return 0;
}
我收到语法错误。
编辑:抱歉缺少部分。
error C2146: syntax error : missing ';' before identifier 'dc1'
error C2065: 'dc1' : undeclared identifier
error C2088: '*' : illegal for struct
error C2086: 'double complex' : redefinition
error C2146: syntax error : missing ';' before identifier 'dc2'
error C2065: 'dc2' : undeclared identifier
error C2088: '*' : illegal for struct
error C2086: 'double complex' : redefinition
error C2146: syntax error : missing ';' before identifier 'result'
error C2065: 'result' : undeclared identifier
error C2065: 'result' : undeclared identifier
error C2065: 'dc1' : undeclared identifier
error C2065: 'dc2' : undeclared identifier
error C2065: 'result' : undeclared identifier
IntelliSense: expected a ';'
IntelliSense: expected a ';'
IntelliSense: expected a ';'
IntelliSense: identifier "result" is undefined
IntelliSense: identifier "dc1" is undefined
IntelliSense: identifier "dc2" is undefined
【问题讨论】:
-
你从哪里得到这些 sysntax 错误?
-
当您发布有关错误的问题时,在问题中包含实际错误(complete 和 unedited)非常有帮助。请编辑您的问题以包含错误。
-
似乎对
complex的支持并没有博文告诉我们的那么完整。 -
很遗憾 VS 对更现代的 C 版本的支持如此糟糕
标签: c visual-studio visual-studio-2013 complex-numbers