Dev-C-compling-installing-running-first-program-with-pictures
Virtual Position Forum :: Members Lounge :: Sciences & Knowledge :: Programing and Design :: C++ Programing
Page 1 of 1 • Share
Dev-C-compling-installing-running-first-program-with-pictures
In order to run a program and see it doing wonderful things, you should first write the program. The program can be written in any text editor, such as vi and emacs in Unix environment and using command prompt in DOS. There are also several Integrated Development Environment (IDE) packages available which provide a complete programming environment for C++ in which you can write, compile, run, and debug your program.
C++ programs are saved with extensions .C, .cc, .cpp, .cxx depending on the platform you are working upon.
Once you have saved a program, next stage is compiling it using a compiler which converts your C++ program into the object code which the computer can understand.
Compile using g++ compiler
If you are using UNIX environment and using g++ compiler, then compiling your C++ program is simple. After you have saved the program file, simply type the command
g++ program.cc –o program
where program is the name of the program. For example the name of our first program is first, then save it using extension “first.cc”. To compile, type
g++ first.cc –o first
To run the program, type first or ./first at the command prompt and your program will run.
Compile using DevC++ compiler
If you work on Windows and use DevC++, then editing and compiling is as easy as click of a button. DevC++ is an IDE which allows you to edit, compile, run and debug your program in the IDE itself. If you want to install DevC++ then install it from here.
1. Once you have installed and configured the software, Write and save your program using DevC++ itself. Create a new program by clicking on New à Project.
[You must be registered and logged in to see this image.]
1. Choose Empty Project from New Project dialog and choose a name for the program, in our case first and click Ok.
[You must be registered and logged in to see this image.]
1. Write the code of the program and save it.
[You must be registered and logged in to see this image.]
1. Click on Compile button (third row, first button) to compile your source code. If there are any errors in your program, then a window at the bottom will specify the warnings.
2. After program is compiled, click on Run button (next to compile).
3. However, DevC++ has a problem. As soon as you Run the program, output window opens momentarily and then it closes. So to come around this solution, set a breakpoint at the end of main function and then click on Debug instead of running it.
[You must be registered and logged in to see this image.]
1. When you run the program, output window will show the string.
[You must be registered and logged in to see this image.]
Compile using VC++
If you use Visual C++ toolkit for C++ programming, then the procedure is same as in DevC++.
1. To write the source code, Click on File à New Project. A dialog box will appear, click on A Empty Project and click Finish. Write your source code in the source code window.
2. After you have saved your source code, click on Build button to compile the source code.
3. Once the source code is compiled, click on Execute button to run the program. An output window will show the output of the program.
C++ programs are saved with extensions .C, .cc, .cpp, .cxx depending on the platform you are working upon.
Once you have saved a program, next stage is compiling it using a compiler which converts your C++ program into the object code which the computer can understand.
Compile using g++ compiler
If you are using UNIX environment and using g++ compiler, then compiling your C++ program is simple. After you have saved the program file, simply type the command
g++ program.cc –o program
where program is the name of the program. For example the name of our first program is first, then save it using extension “first.cc”. To compile, type
g++ first.cc –o first
To run the program, type first or ./first at the command prompt and your program will run.
Compile using DevC++ compiler
If you work on Windows and use DevC++, then editing and compiling is as easy as click of a button. DevC++ is an IDE which allows you to edit, compile, run and debug your program in the IDE itself. If you want to install DevC++ then install it from here.
1. Once you have installed and configured the software, Write and save your program using DevC++ itself. Create a new program by clicking on New à Project.
[You must be registered and logged in to see this image.]
1. Choose Empty Project from New Project dialog and choose a name for the program, in our case first and click Ok.
[You must be registered and logged in to see this image.]
1. Write the code of the program and save it.
[You must be registered and logged in to see this image.]
1. Click on Compile button (third row, first button) to compile your source code. If there are any errors in your program, then a window at the bottom will specify the warnings.
2. After program is compiled, click on Run button (next to compile).
3. However, DevC++ has a problem. As soon as you Run the program, output window opens momentarily and then it closes. So to come around this solution, set a breakpoint at the end of main function and then click on Debug instead of running it.
[You must be registered and logged in to see this image.]
1. When you run the program, output window will show the string.
[You must be registered and logged in to see this image.]
Compile using VC++
If you use Visual C++ toolkit for C++ programming, then the procedure is same as in DevC++.
1. To write the source code, Click on File à New Project. A dialog box will appear, click on A Empty Project and click Finish. Write your source code in the source code window.
2. After you have saved your source code, click on Build button to compile the source code.
3. Once the source code is compiled, click on Execute button to run the program. An output window will show the output of the program.
Nilofer Bugti- Monstars
- Posts : 585
Join date : 2011-04-11
Similar topics
» I'm having some trouble installing my EVO 3G
» Installing XP in 10 Minutes With Screenshot
» Installing Custom Shapes and Brushes in Photoshop
» UK ‘running out of new web addresses'
» Hard rains still running riot in Sindh
» Installing XP in 10 Minutes With Screenshot
» Installing Custom Shapes and Brushes in Photoshop
» UK ‘running out of new web addresses'
» Hard rains still running riot in Sindh
Virtual Position Forum :: Members Lounge :: Sciences & Knowledge :: Programing and Design :: C++ Programing
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
Yesterday at 12:21 pm by ali001
» Hemangiom'App
Tue Nov 05, 2024 11:25 am by ali001
» MindfulMe - Mental Health App
Mon Nov 04, 2024 10:50 am by ali001
» Learn Candlestick Patterns
Tue Oct 15, 2024 5:51 am by ali001
» Woh Pagal Si Episode 52 to 62 - Top Pakistani Drama
Sat Sep 21, 2024 6:26 pm by Mir Emmad Ali Khan Domki
» Nearu - share your socials
Sat Sep 21, 2024 1:12 pm by ali001
» Nightclub Tycoon: Idle Empire
Thu Sep 19, 2024 9:16 pm by ali001
» Carnivore - Meat Diet Recipes
Wed Sep 18, 2024 2:37 pm by ali001
» Eid Milad un Nabi Mubarak 2024 (Rabiʻ I 14, 1446 AH)
Tue Sep 17, 2024 3:44 pm by Mir Emmad Ali Khan Domki