banner



How To Check C++ Version In Windows 10

Prev     Side by side

C Surroundings Setup using GCC:

In this chapter, we are going to learn how to setup C development environment using GCC compiler in your machine and how to compile and execute a C program by your own.

Notation:

  • GCC (GNU Compiler Collection) is a compiler used to compile both C and C++ programs.
  • GCC is just a compiler. Information technology is not an IDE ( Integrated Development Surroundings ) such as Turbo C++, Borland C++ and Dev C++
  • We accept to use window's command prompt to compile and execute C and C++ programs.

Steps to install GCC compiler :

i. Go to http://sourceforge.internet/projects/mingw/files/

2. Download the latest version (Check the line "Looking for the latest version? "Download mingw-get-setup.exe (86.five kB)") and click on this link.

iii. Once download is completed, double click on exe file. Shortcut may be available in your desktop.

four. Click on "All Bundle", and so choose the C compiler every bit shown below. Please choose all the GNU C Compiler listed in below window. Then, Click on Installation ->Utilise Changes.

Step4.1

Step4.2

  • The beneath stride is for C++ Compiler installation. If you lot desire to install C++ compiler, you can follow this step. Else, yous tin can motility to step5.

Step4.4

Step4.5

v. In one case installation is completed, go to your desktop and correct click on My Computer -> properties -> advanced organization settings -> advanced tab. And then, click on "Surroundings Variables" push button and then "New". Yous will get a popup window as shown below.

Modify the System variable equally given below.

Variable proper noun: PATH
Variable value: C:\MinGW\bin;

Step5

6. Restart you motorcar.

7. Open command prompt (Blazon "cmd" in search box).

8. Blazon "gcc –version" in command prompt to check whether C compiler is installed in your machine. Blazon "g++ –version" in command prompt to check whether C++ compiler is installed in your auto. But, nosotros are good if C compiler is installed successfully in our machine as of now.

Step8

ix. Open notepad or text document and type any simple program and save this file as test.c (You can put any proper name for file. But, brand certain that information technology is saved with .c extension).

Step9

Some basic commands yous need to know before compiling and executing C plan using command prompt:

  • To get to particular directory, use this command – cd {full_path} (for example : cd c:\MinGW\bin)
  • To listing all the files in a directory, use this command – dir { full_path_of_directory} (for example : dir c:\MinGW\bin)
  • To rename a file, use this command – ren {old_file_name} {new_file_name} (for instance : ren test.c.txt test.c)
  • To compile a C program, employ "gcc file_name.c" (for example : gcc test.c)
  • To execute C program, use "a.exe" in command prompt
  • To clear the sceen, use "cls" command

10. Go to the respective direcory in command prompt where you take saved your C program file and compile your C program using "gcc file_name.c" command.

Notation:

  • Sometimes, when you type C program in notepad or text editor and save the file every bit "file_name.c", information technology would exist saved as "file_name.c.txt".
  • This file can't exist compiled by compiler.
  • When you meet this file in windows folder, which will await good as file_name.c.
  • But, when you listing all bachelor files in the directory where you take placed your program file using "dir { full_path_of_directory}" command in command prompt, you can able to see file name volition be as "file_name.c.txt"
  • So, y'all take to rename this file in control prompt using "ren {old_file_name} {new_file_name}" command, and then compile the program.

eleven. Run your C programme using "a.exe" control in control prompt. Y'all tin can see the output equally below.

Step1011

Prev     Next

Similar it? Delight Spread the word!

Source: https://fresh2refresh.com/c-programming/c-environment-setup-using-gcc/

Posted by: hughtitheivelt.blogspot.com

0 Response to "How To Check C++ Version In Windows 10"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel