C99 中 _Complex 用法示例

11 views
Skip to first unread message

bruc...@gmail.com

unread,
Dec 21, 2005, 4:07:24 AM12/21/05
to 星星爱CPP
float _Complex a = 1.1F + 2.2iF; // 关键字_Complex;
注意2.2后的i
float a_real = __real__ a; // 关键字__real__
float a_imag = __imag__ a; // 关键字__imag__

当然,大部分的操作早已封装在标准文件 complex.h
中了。
#include <complex.h>
之后可以轻松的使用。

Reply all
Reply to author
Forward
0 new messages