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
 

sshahid47

Advanced Member level 4
Joined
Nov 5, 2004
Messages
101
Helped
15
Reputation
30
Reaction score
2
Trophy points
1,298
Activity points
974
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)
 

deepu_s_s

Full Member level 5
Joined
Mar 24, 2007
Messages
305
Helped
15
Reputation
30
Reaction score
5
Trophy points
1,298
Activity points
3,021
Re: help c++

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

thanks and regards
deepak
 

saeed_pk

Full Member level 4
Joined
May 20, 2006
Messages
238
Helped
35
Reputation
68
Reaction score
27
Trophy points
1,308
Location
Islamabad, Pakistan
Activity points
2,667
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

Top