What is the standard way of naming source files in C?

c, naming-conventions

Solution

There's no mandatory convention. In part, it depends on whether your system has a case-sensitive or case-insensitive file names.

The `.c` suffix (lower-case) is essentially universal for source files, and the `.h` for header files. Other files included in source files may have different extensions, or no extension at all.

Classically, the names were all lower-case (look at the standard header names, for example). The names avoid accented characters, spaces and many other punctuation characters, usually adhering to the portable filename character set (alphanumerics, underscore, dash, dot). Other than that, the choice is largely up to you.

Problem

Is there a standard way of naming source code files in C? E.g. Should they be underscore separated, capitalized, camel case?

Original source