I'm new I want to know c ++ and i followed all steps in notepad++. Can anyone told me what can I do here means how run my program and other staff? ⚕️
-
I’m new I want to know c ++ and i followed all steps in notepad++. Can anyone told me what can I do here means how run my program and other staff? ⚕️
-
Notepad++ is a text editor. You type your C++ code in there, and the syntax highlighting in Notepad++ will make it easier to visually parse the code you are typing. Then you use an external compiler to compile your source code, then you run the executable. In a bog-standard approach, all Notepad++ is used for is typing.
If you have a plugin like the NppExec plugin, you can help automate some of the steps. For example, I have written a script for NppExec plugin that I call
gcc-CompileAndRun
, which saves the active file, runs gcc on that file to create an executable with the same name, then runs the executable in the NppExec console window:NPP_SAVE cd "$(CURRENT_DIRECTORY)" gcc -o "$(NAME_PART)" "$(FILE_NAME)" $(NAME_PART)
(This script only works on a self-contained, single-file c program. if you used
g++
instead ofgcc
, it would work on a self-contained, single-file c++ program. You could have a similar script which runs your own copy ofmake
– or similar, as appropriate to what C++ compiler and build system you have: the Notepad++ source code, when you are building it with mingw-based g++, usesmingw32-make
; strawberryperl comes with a mingw-based gcc/g++ compiler setup, usesgmake
(which might be just a rebrandedmingw32-make
, but I’m not sure); and I know I’ve heard that some c++ setups on Windows can use CMake – but, anyway, if you have a makefile with your project, you could easily do a similar NppExec script that would run the right flavor of make with an appropriate target, rather than directly compiling one c/c++ file and running its executable.(Personally, I stick with NppExec for the single-file programs, but for anything more complex, I’m more likely to just do the code editing in Notepad++ and then go to a Windows command-line-prompt to run makefiles and the like. And for C++ apps built with the VisualStudio ecosystem, I have given in and started to use that full IDE environment, because debugging is more convenient that way.)
This forum actually has a FAQ entry on how to Compile using an external compiler from Notepad++, which reiterates some of what I told you above, and also has a bit more on the specifics of the NppExec plugin.
This forum is not really the best resource for learning C++, because C++ is just one of the 90+ languages that Notepad++ knows how to syntax highlight, and this forum is focused on the Notepad++ aspects, not on the specific coding language you want to use or programming tasks you want to accomplish. There are tons of websites out there dedicated to helping you learn C++; and there are other forums (like stackexchange) that are better suited to getting answers to coding questions, so you’ll get better answers to coding questions someplace like that than you will here.
So, if you have specific questions about the use of Notepad++ and its plugins that the FAQ and my brief introduction to using NppExec for compiling C++ code didn’t cover, feel free to ask, because questions specific to Notpead++ is the reason this Forum exists and most of the regulars come to answer questions.