Re: Structure return

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Paulo Flabiano Smorigo <pfsmorigo@xxxxxxxxx> writes:

> Is it possible to return a structure as the function return?

Yes.  This is a standard part of C/C++.


> I made a program to test if it's possible and worked, but now I have a
> few doubts:
> - It's secure to use this procedure?

Yes.

> - It's a true structure return or something else?

It's a true structure return.  I'm not sure what else it could be.

> - The ansi c standard allow this or it's a "plus" of gcc?

The standard allows it.


(There were compilers in the distant past for which returning a struct
was not thread-safe, because they used a static variable to return the
struct.  However, those compilers are long dead.  Returning a struct
is perfectly safe these days.)

Ian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux