Run C++ in command prompt - Windows

前端 未结 11 1675
逝去的感伤
逝去的感伤 2020-12-22 19:02

I know that everyone uses an IDE nowadays, but I just find it simpler to write my code in notepad++, compile it using a command prompt command, and run it from there too. At

11条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-22 19:30

    Steps to perform the task:

    1. First, download and install the compiler.

    2. Then, type the C/C++ program and save it.

    3. Then, open the command line and change directory to the particular one where the source file is stored, using cd like so:

      cd C:\Documents and Settings\...
      
    4. Then, to compile, type in the command prompt:

      gcc sourcefile_name.c -o outputfile.exe
      
    5. Finally, to run the code, type:

      outputfile.exe
      

提交回复
热议问题