Compilation procedure in windows("cmd")
Title
Question
Respected sir,
We need a complete procedure of compilation of simple c program in windows("cmd").
We need a complete procedure of compilation of simple c program in windows("cmd").
C-and-Cpp First-C-Program 00-01 min 0-10 sec
Answers:
Hello,
Pls refer to the Installation Sheet given at this link to know how to install and run mingw compiler on Windows OS using "cmd".
http://spoken-tutorial.org/media/videos/43/C-and-Cpp-Installation-Sheet-English.pdf
Tnx and rgds,
Nancy Varkey
Pls refer to the Installation Sheet given at this link to know how to install and run mingw compiler on Windows OS using "cmd".
http://spoken-tutorial.org/media/videos/43/C-and-Cpp-Installation-Sheet-English.pdf
Tnx and rgds,
Nancy Varkey
1. Write the program in Notepad++ in some folder in a drive (E.g. Create a folder program in D drive. )
#include<stdio.h>
void main()
{
printf("hello");
}
Give a file name Sample.cand Click Filemenu and saveit
Take command prompt by typing cmd in Run
Then change directory to the place where you saved the file (E.g your file Sample. c is in D:\\program)
Type
D:
cd program
(This will give a prompt D:\\program>)
2. COMPILE THE PROGRAM
Type
gcc Sample.c -o sample
(Here sample.exe will become the name of the output file)
press enter key
This will compile the program
If no error nothing will be shown. Otherwise it will show error details then correct the error and again compile)
/If no error RUN the program
type
sample.exe
Type the following for program compilation:
D:\\program>>gcc -o Sample Sample.c
Sample is a .exe file created in the same folder of Sample.c
Type the following to run the .exe program:
D:\\program>>Sample
Login to add comment
Login to add comment