Apply for Zend Framework Certification Training

c



< c compiler installation How to print in c in different ways >



Compile a C file using its filename

To compile a C file using its filename, you normally use a C compiler such as GCC.
Suppose your C file is named:
program.c
1. Compile the C file
Open Command Prompt / Terminal and type:
gcc program.c
This creates an executable file.
On Windows, the default executable is usually:
a.exe
Run it with:
a.exe
or:
.\a.exe
2. Give your executable a specific name
You can use the -o option:
gcc program.c -o program
Then run:
Windows:
program.exe
Linux/macOS:
./program

< c compiler installation How to print in c in different ways >



Ask a question



  • Question:
    {{questionlistdata.blog_question_description}}
    • Answer:
      {{answer.blog_answer_description  }}
    Replay to Question


Back to Top