Site icon TestingDocs.com

C Program Files & Formats

Overview

In this tutorial, we will learn about different C Program files and file formats. The different file formats involved in designing, compiling, and running a C program are as follows:

Source File

The C Source file contains the source code of the C program. The file contains source code that defines the main() function and may contain user-defined functions. The file extension of the source file is *.c

For example, hello.c

Header File

The C header file contains the C function declarations and macro definitions and is to be shared between several source files. The file extension of the C header file is *.h

For example, utility.h

Object File

An object file is a file containing object code i.e relocatable format machine code that is usually not directly executable. Object files are produced by language translators like an assembler, or compiler and used as input to the linker program, which in turn generates an executable or library by combining the object files. The file extension of the C object file is *.o

For example, hello.o

Executable File

The binary executable file is generated by the linker program. The linker links the
various object files to produce a binary file that can be directly executed. The
typical file extension of the executable file is *.exe

For example, hello.exe

 

C Tutorials

C Tutorials on this website can be found at:

https://www.testingdocs.com/c-language-tutorial/

Exit mobile version