Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to use fprintf function in C++ to send complex data?

Status
Not open for further replies.

fatma1000

Banned
Joined
Apr 30, 2006
Messages
147
Helped
3
Reputation
6
Reaction score
2
Trophy points
1,298
Location
eygpt
Activity points
0
please i need to send data from c++ program to file but these data are complex

so please tell me how can i use fprintf function to send complex data

thanks
 

help c++

Hi,
what sort of data is this ? do you mean its of the format x+yi, where y is the imaginary part ? in that case use the following

fprintf(fileptr,"%d + %di",x,y)
 

Re: help c++

hi !
what sort of data u want to send? be more clear in your question?

thanks and regards
deepak
 

Re: help c++

if u are talking about a+jb ( complex numbers)

Use <complex.h> ( Borland C compiler)
Use the function " double imag( complex x)
this returns the imaginary part of complex number x
similarly "double real(complex x)
this returns the real part of complex number x

you can assign these values to any other double variable
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top