Compartir a través de


_fileno (Windows CE 5.0)

Send Feedback

Developing an Application > Microsoft C Run-time Library for Windows CE > Run-time Library Reference

Gets the file handle associated with a stream.

void* _fileno(    FILE*stream);

Parameters

  • stream
    Pointer to FILE structure.

Return Values

_fileno returns a null pointer to the OS file handle.

There is no error return.

If stream does not specify an open file the result is undefined.

Remarks

This routine is implemented both as a function and as a macro.

Example

/* FILENO.C: This program uses _fileno to obtain
 * the file handle for some standard C streams.
 */

#include <stdio.h>

void main( void )
{
   printf( "The file handle for stdin is %d\n", _fileno( stdin ) );
   printf( "The file handle for stdout is %d\n", _fileno( stdout ) );
   printf( "The file handle for stderr is %d\n", _fileno( stderr ) );
}

Output

The file handle for stdin is 0
The file handle for stdout is 1
The file handle for stderr is 2

Requirements

OS Versions: Windows CE 2.0 and later.
Header: stdlib.h.
Link Library: coredll.dll.

See Also

fopen

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.