duong van yen wrote:
> Dear groups,
> I try to know how to use cabs() function from this
> example:
> #include <stdio.h> 
> #include <math.h> 
>  struct complex
> {
> double x, y;
> };
> int main(void) 
> { 
>   struct complex z; 
>  
>   z.x = 1; 
>   z.y = 2; 
>  
>   printf("%f", cabs(z)); 
>  
>   return 0; 
> }
> and i get the error:
> " error C2664: 'cabs' : cannot convert parameter 1
> from 'complex' to '_complex' "
> can anyone explain the reason why?, and how to correct
> it?
> thanks
> regards,
> Duong Van Yen

Microsoft decided to deprecate ANSI C/C++ with the latest PSDK.  I can't 
really blame them except they replaced everything with function names 
that are preceded with an underscore.  That creates incredibly ugly 
looking code.

You shouldn't be defining the 'complex' structure - should already be 
defined for you in math.h.  MSDN says to use 'struct _complex':

http://msdn2.microsoft.com/en-us/library/837f6cdb(VS.80).aspx

-- 
Thomas Hruska
CubicleSoft President
Ph: 517-803-4197

*NEW* VerifyMyPC 2.5
Change tracking and management tool.
Reduce tech. support times from 2 hours to 5 minutes.

http://www.CubicleSoft.com/VerifyMyPC/

Reply via email to