delorie.com/archives/browse.cgi | search |
Message-Id: | <199812121407.OAA19058@remus.clara.net> |
From: | "Arthur" <arfa AT clara DOT net> |
To: | <djgpp AT delorie DOT com> |
Subject: | RE: [Q]complex in djgpp |
Date: | Sat, 12 Dec 1998 14:06:20 -0000 |
X-Priority: | 3 (Normal) |
X-MSMail-Priority: | Normal |
X-Mailer: | Microsoft Outlook 8.5, Build 4.71.2173.0 |
X-MimeOLE: | Produced By Microsoft MimeOLE V4.72.3110.3 |
In-Reply-To: | <001701be25b0$73ec7260$2ef8c6c3@johans-dator> |
Importance: | Normal |
Reply-To: | djgpp AT delorie DOT com |
> >I want to compile this program types. > > > >/* main.C */ > >#include <complex.h> > >... > >int main(void) > >{ > > complex a,b,c; > > b=sin(a) > > c=a+b; > >.... > >} > > > >BUT > > > >commnad : > > g++ -c main.C > > > >error messange : > > main.C:81 'complex' undeclared <first use this function> > > > >How can I overcome this compile error. > > What is a complex? A complex number is a number consisting of two parts - a real part (what you know as numbers) and an imaginary part (a multiple of the square root of -1). C++ contains an overloaded class to handle these kind of numbers. Section 8.10 of the FAQ suggests you try using an optimisation, such as -O. James Arthur - jaa AT arfa DOT clara DOT net http://www.jado.org/users/arfa/ ICQ#15054819
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |