Profile photo for Neel Makhecha

I’m assuming that you mean “Operating System” by “Platform”. Now let me make this thing clear, that “C Programs” does not depend on platforms actually. BUT, the executable file that is generated at the end for running the C-program may depend on a platform.

Now, you know that C Programs have generally “.c” as their extension. Now when you compile that program, the compiler forms an object file “.o” (in most cases). When you run, it generates an executable file. The extension and type of this executable file depends on the compiler you are using, and on which OS you are using the particular compiler.

For example, suppose you are writing a code on a Windows PC and using Code Blocks as an IDE with GCC GNU Compiler. Now when you compile and run that code, the file that’s actually running will be of type “.exe”. The exe file on Windows is executable file, which gets executed.

Now similarly, when you use other OS you get other extension for exectuable files. Example, when I use Mac for programming in C, when I compile it and run it, a file with an extension “.out” is generated. This file is generated when you compile it using the terminal of macOS or any other Unix terminal. But in case of Linux, there is no any exact standard type of extension that you can say its an extension of all executable files.

By this explanation, what I mean to say is, when you say “C Program” are platform dependent, then its not correct. The C Program alone with their extension as “.c” format can be copied and used on any platform, whether Windows, macOS or Linux. But the executable file formed at the end is dependent on the platform. The compilers for that particular OS is responsible for that.

View 12 other answers to this question
About · Careers · Privacy · Terms · Contact · Languages · Your Ad Choices · Press ·
© Quora, Inc. 2025