[cs631apue] function forward declarations

Robert Schabacker rschabac at stevens.edu
Wed Sep 8 22:26:07 EDT 2021


There's nothing special about the header files, including them just
copy-pastes forward definitions into your file. You can forward declare
any function, just make sure the types match up with the type the
function is defined with.

On Wed, Sep 8, 2021 at 9:03 PM Jan Schaumann <jschauma at stevens.edu> wrote:

> Timothy Wang <twang77 at stevens.edu> wrote:
>
> > This leads me to believe that the underlying
> > implementation of getlogin is written in the OS
> > itself and C code will only have to declare the
> > function either through unistd.h or writing ?char  *
> > getlogin(void);?.
>
> Any other takers?
>
> What about other functions, like, say, "printf" or
> "open" and "close"?
>
> Can we forward declare those ourselves, or must we
> include a header for them?
>
> -Jan
> _______________________________________________
> cs631apue mailing list
> cs631apue at lists.stevens.edu
> https://lists.stevens.edu/mailman/listinfo/cs631apue
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.stevens.edu/pipermail/cs631apue/attachments/20210908/ce2fb634/attachment.html>


More information about the cs631apue mailing list