C Standard Library

C <stdio.h> - FOPEN_MAX constant

The C <stdio.h> FOPEN_MAX is a macro constant that expands to an integral expression that represents the maximum number of files that can be opened simultaneously. Particular library implementations may count files opened by tmpfile() towards this limit. Implementations may also allow more files to be opened beyond this limit.

In the <stdio.h> header file, it is defined as follows:

#define FOPEN_MAX /*implementation defined*/             


The example below shows the value of FOPEN_MAX constant on a given implementation.

#include <stdio.h>
int main (){
  //displaying the value of FOPEN_MAX
  printf("FOPEN_MAX = %d\n", FOPEN_MAX);
  return 0;

One of the possible output of the above code could be:


❮ C <stdio.h> Library