Facebook Page Twitter Page LinkedIn Page
× C Standard Library


The C <stdio.h> FILENAME_MAX is a macro constant that expands to an integral expression corresponding to the size needed for an array of char elements to hold the longest file name string allowed by the library. If the library imposes no such restriction, it is set to the recommended size for character arrays intended to hold a file name.

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

#define FILENAME_MAX /*implementation defined*/             

Example:

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

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

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

FILENAME_MAX = 4096

❮ C <stdio.h> Library

5