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.

Can a C function return 2 values?

Status
Not open for further replies.
Re: c function ?

No. The work around is you can update any number of values in an array or structure which is declared globally and then use the updated values in the global variable.
 
c function ?

You could put the two values into a struct, and then return the struct.
 

Re: c function ?

Just a hint...
In my experience, the function should return an error code, usually.
And te real "returned" values(computed in the function body) should be returned via function parameters.
 

c function ?

That's probably not the best approach if, for example, the function returns the product of two complex numbers. ;)
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top