I am learning C, and start using Notepad++ as a text editor as an author mentioned in his beginning C book that I am reading. At first, I didn't see the real power of Notepad++ until I learnt that I could do splitting screens and other stuff like hiding coding lines... while editing my source code. And now, with Notepad++, I am able to add on an optional feature / plugin that will allow me to compile and execute all my C programs from within my Notepad++ editing! All such things really mean Notepad++ is even more powerful and greater. And now I am learning that I could even choose different compilers (minGW, VC,..) in my scripting setups! What can I say? Thank you so much for such a great video.
hey dude I am sorry I did not reply to you earlier but this is the problem exactly: So the problem is with files taking some input , the code is let's say : #include int main() { int d ; printf("Enter age."); scanf("%d",&d); printf("%d",d); return 0; } Now when I run this in the nppexec console following all your instructions, nothing happens , there is just a cursor blinking, so I type something on the keyboard(say 2) and press enter , then it prints : Enter age.2 Why is it not printing the prompt first and then taking input ? In case multiple inputs in the code , what it does is that it takes all the inputs first , then prints the prompt printf statements , skips the scanf statements and gives the output .
@@CodeVault it's not a major problem, I come from VS code so I like the integrated terminal . There is this "khaki" theme on notepad++ which I love , but I cannot find a way to replicate it on VS code . No extensions are there. Anyways I shall thank you for cooperation ! Your channel is great.
if we design a custom program (similar to arduino ide) using visual studio, could we make it compile and upload the codes to an MCU and how? I would highly appreciate your efforts if you make a tutorial on this.
Hey I tried getting onop (minGW. org) but the domain has expired, there i another one at (sourceforge. net) But I just whant to be sure that there are others that have experience with this website before going and downloading from there. and there is sure to be others that think the same, thanks for anny responds. And thanks for helping out with notepad ++
Thanks. The .exe extension for the output file didn't work for me so I got rid of it and things started working. Just another hint for those who aren't English speaking natives, go to settings, new document, change the encoding to either ansi (the first ticking option) or to windows-1252 (in the bottom dropdown), in your new file include locale.h and use the setlocale in Main.
Hi , i have run into a problem here. This runs okay for all C code , except the ones asking for input. It waits for a prompt, and after the prompt is given , it assumes the prompt as input and skips the actual scanf() code that should be asking for input. I would be grateful if you find out what's wrong.
@@CodeVault hey I am sorry I did not reply but this is the problem exactly: So the problem is with files taking some input , the code is let's say : #include int main() { int d ; printf("Enter age."); scanf("%d",&d); printf("%d",d); return 0; } Now when I run this in the nppexec console following all your instructions, nothing happens , there is just a cursor blinking, so I type something on the keyboard(say 2) and press enter , then it prints : Enter age.2 Why is it not printing the prompt first and then taking input ? In case multiple inputs in the code , what it does is that it takes all the inputs first , then prints the prompt printf statements , skips the scanf statements and gives the output .
CodeVault, I currently can't test the script that uses the Visual Studio Community in my PC yet (that is for the future.) However, when I looked into your updated script (the updated version of Visual Studio community) above, I notice there is a "2019" in the path of the cd (change directory) command. I am wondering if you can change that "2019" to something more generalized, that will help the script still to be working in the far more future when Microsoft releases newer versions (like 2020, 2021,...) to the public. Will something like this "cd $(CURRENT_DIRECTORY)" work? Thanks again. Great!
I could change to something like , but then people might omit replacing that to their own version and wouldn't help that much. Couple that with the fact that the path itself might change in the next version of VS, I think 2019 is fine (for now).
Many people learn C (i guess) because they want to make a game or even a emulator (like CHIP8) in SDL (or OpenGL) or to make a usable program in GTK, well i'm one of them, i will like to put to a good use what i learn and learn more, this is a good idea for more videos
by both ways i could see below error ; about to start a child process: ""new1.exe"" CreateProcess() failed with error code 2: The system cannot find the file specified.
In the description I have added a separate script so that the resulting executable doesn't execute if the compilation fails. You can use that. And double check that your program does, in fact, compile and it's in the right directory. Also, that "new1" name might mean you're using temporary files, try saving the file somewhere and then compiling it
@@CodeVault not working Here is the code reply me with the correct changes. #include int main() { int a,b; printf("Enter the value of a "); scanf("%d",&a); printf("Enter the value of b "); scanf("%d",&b);
printf("The sum of a and b is %d",a+b); return 0; }
Hi!! I am using the Notepad ++ text editor but it does not recognize the "src" and "url" in the @ font-face of the css code to import custom fonts. What can I do to solve this problem?
@@CodeVault The only problem that I have editing in css with Notepad ++ is that it does not recognize the SRC (source) and URL inside the @ font-face. This is what I am writing in the css code of Notepad ++ text editor: @font-face{ font-family: Piedra Regular; src: url(E:\Diseño web\Fonts\Piedra-Regular.ttf);
Yeah, you can't specify absolute paths in CSS since this is ran in the browser. You'll need to specify relative paths to the CSS file (inside the webserver). So you'll have to copy the .ttf file in your source folder.
@@CodeVault after creating s c compiler as shown in the video. we are unable to give any input in run time only hello world type program works that means if any scanf function is present notepad console hangs there itself
@CodeVault good evening, I would like to know from you with greater clarity; given my little programming experience, what use this script is, summing up in a few words. npp_save cd "$(CURRENT_DIRECTORY)" cmd /c gcc -o "$(NAME_PART).exe" "$(FULL_CURRENT_PATH)" && "$(NAME_PART).exe
First line is for saving the current file. Second one just changes the current working directory to be the directory of the current file. Then the last one simply compiles the current file to a file that's named the same but with .exe extension.
Hey CodeVault, it seems the script that is using MinGW didn't stop when the compiling process hits a syntax error, but it would go on with the execution process as if no syntax errors were found! You can re-create a simple test by taking out a semicolon at the end of any statement (let say we do "return 0" rather than "return 0;"). In this case, the compiling process shouldn't go any further when it hits a syntax error. Please fix and update the script. Thanks!
I figured it out. Try this script instead: npp_save cd "$(CURRENT_DIRECTORY)" cmd /c gcc -o "$(NAME_PART).exe" "$(FULL_CURRENT_PATH)" && "$(NAME_PART).exe" Without running the command "cmd /c" each command line is ran completely separate, so there's no way of checking. Similarly with the Visual C one.
Header files (.h) you simply include in your source files (.c/.cpp). If you have multiple source files you could either expand the gcc command with more .c/.cpp files or use make/cmake for creating a script that compiles everything for you. Something along the lines of: gcc -o main.exe main.c src_print1.c src_print2.c
Hi, does anybody have a problem with "Operation did not complete successfully because the file contains a virus or potentially unwanted software." when trying this? I believe this Windows + MinGW combination problem, not Notepad (7.8.1) specific; versions are Windows 10 (Version 1909, OS build 18363.900), Mingw32-gcc-bin 9.2.0-1 ; BR
Odd... Looks like Windows Defender is at fault. Try disabling real time protection and see if that makes it work. I think it sees the compiled executable as a threat.
@@CodeVault Hi, yes it looks like WIndows Defender, Virus & threat protection "feature, not bug". Way out is a) disable "Real-time protection" or better b) add "Exclusion folder" where exe is created. It is same behavior in shell and Notepad and VSCode, but not for example in CodeLight IDE (which I think also use MinGW). BTW, thanks for all these simple and great videos
"new 1.exe" ; about to start a child process: ""new 1.exe"" CreateProcess() failed with error code 2: The system cannot find the file specified. I got this on the console, I guess it should be something about the path????
@@CodeVault well, no, I didn't. I deleted it and I executed a c file (coded on VSCode) with NppExec and the compiler didn't work well. However, when I run the same code on VSC it works fine, so I guess I did something wrong. I usually use VSC to code python because is very easy-to-use, and it works fine coding c on it.
Hmm, you need to save it, otherwise the compiler doesn't know where the file is (even if it exists in temp). You can certainly compile/debug/execute C code in VSCode too, there's a video I made on this topic: ua-cam.com/video/N5GhV8K8DIc/v-deo.html
Thanks for the video, did exactly what you said, but am getting the error: C:/GCC/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot open output file g++.CharacterArrays.exe: Permission denied
Thank you for the videos CodeVault; I'm currently taking a class in Operating Systems and I need to learn a lot in C. Your videos help a lot
I am learning C, and start using Notepad++ as a text editor as an author mentioned in his beginning C book that I am reading. At first, I didn't see the real power of Notepad++ until I learnt that I could do splitting screens and other stuff like hiding coding lines... while editing my source code. And now, with Notepad++, I am able to add on an optional feature / plugin that will allow me to compile and execute all my C programs from within my Notepad++ editing! All such things really mean Notepad++ is even more powerful and greater. And now I am learning that I could even choose different compilers (minGW, VC,..) in my scripting setups! What can I say? Thank you so much for such a great video.
Hi nerds :)
im trying to learn the basics ( compile + coding ) its really hard
big respect for all the nerds around the world
hey dude I am sorry I did not reply to you earlier but this is the problem exactly:
So the problem is with files taking some input , the code is let's say :
#include
int main()
{
int d ;
printf("Enter age.");
scanf("%d",&d);
printf("%d",d);
return 0;
}
Now when I run this in the nppexec console following all your instructions, nothing happens , there is just a cursor blinking, so I type something on the keyboard(say 2) and press enter , then it prints :
Enter age.2
Why is it not printing the prompt first and then taking input ?
In case multiple inputs in the code , what it does is that it takes all the inputs first , then prints the prompt printf statements , skips the scanf statements and gives the output .
Haven't tried running in Notepad++ in a while... You can always just use the terminal to compile and run the programs that way
@@CodeVault it's not a major problem, I come from VS code so I like the integrated terminal . There is this "khaki" theme on notepad++ which I love , but I cannot find a way to replicate it on VS code . No extensions are there.
Anyways I shall thank you for cooperation ! Your channel is great.
Thanks sir. This was very helpfull.
Sir, Please explain me how to run POSIX thread programs from notepad++.waiting for your explanation.
pthread.h is a Linux specific library. You should try to either use WSL on Windows or work on Linux.
How about for this one?
'gcc' is not recognized as an internal or external command,
operable program or batch file.
You need to make sure gcc is in your PATH variable
if we design a custom program (similar to arduino ide) using visual studio, could we make it compile and upload the codes to an MCU and how?
I would highly appreciate your efforts if you make a tutorial on this.
I think you can but I don't have experience with that. I'll look into it
There is a python application where it "compiles" and programs a device (where I saw it, it was programming an EEPROM)
Thank you so much. Now I can compile and run my Fortran files and run them in Notepad++. Thank you!!
Hey I tried getting onop (minGW. org) but the domain has expired, there i another one at (sourceforge. net) But I just whant to be sure that there are others that have experience with this website before going and downloading from there. and there is sure to be others that think the same, thanks for anny responds.
And thanks for helping out with notepad ++
I can answer myself after I have now downloaded it, but I went to( sourceforge. net/projects/mingw/) for those who need the same file
Thanks. The .exe extension for the output file didn't work for me so I got rid of it and things started working. Just another hint for those who aren't English speaking natives, go to settings, new document, change the encoding to either ansi (the first ticking option) or to windows-1252 (in the bottom dropdown), in your new file include locale.h and use the setlocale in Main.
I know it's kinda off topic but does anybody know a good website to watch newly released series online ?
@Devin Carl i use FlixZone. You can find it by googling :)
@Armani Zayne Yea, been using FlixZone for months myself :D
@Armani Zayne thank you, I went there and it seems like they got a lot of movies there =) I appreciate it!!
@Devin Carl glad I could help :)
Sir, I want to include graphics header file for C in Notepad++... Please tell me how???
I think this is what you're looking for if you're using MinGW: stackoverflow.com/questions/8063314/graphics-for-mingw
Thank you bro very much it worked man ,😀
Hi , i have run into a problem here. This runs okay for all C code , except the ones asking for input. It waits for a prompt, and after the prompt is given , it assumes the prompt as input and skips the actual scanf() code that should be asking for input.
I would be grateful if you find out what's wrong.
It should work... Is the value that it read the actual prompt text?
@@CodeVault same problem here...
also, tutorial was very helpful
@@CodeVault hey I am sorry I did not reply but this is the problem exactly:
So the problem is with files taking some input , the code is let's say :
#include
int main()
{
int d ;
printf("Enter age.");
scanf("%d",&d);
printf("%d",d);
return 0;
}
Now when I run this in the nppexec console following all your instructions, nothing happens , there is just a cursor blinking, so I type something on the keyboard(say 2) and press enter , then it prints :
Enter age.2
Why is it not printing the prompt first and then taking input ?
In case multiple inputs in the code , what it does is that it takes all the inputs first , then prints the prompt printf statements , skips the scanf statements and gives the output .
CodeVault, I currently can't test the script that uses the Visual Studio Community in my PC yet (that is for the future.) However, when I looked into your updated script (the updated version of Visual Studio community) above, I notice there is a "2019" in the path of the cd (change directory) command. I am wondering if you can change that "2019" to something more generalized, that will help the script still to be working in the far more future when Microsoft releases newer versions (like 2020, 2021,...) to the public. Will something like this "cd $(CURRENT_DIRECTORY)" work? Thanks again. Great!
I could change to something like , but then people might omit replacing that to their own version and wouldn't help that much. Couple that with the fact that the path itself might change in the next version of VS, I think 2019 is fine (for now).
Many people learn C (i guess) because they want to make a game or even a emulator (like CHIP8) in SDL (or OpenGL) or to make a usable program in GTK, well i'm one of them, i will like to put to a good use what i learn and learn more, this is a good idea for more videos
We could make a tutorial series for a 3D game engine in OpenGL, if that's what you mean.
by both ways i could see below error
; about to start a child process: ""new1.exe""
CreateProcess() failed with error code 2:
The system cannot find the file specified.
In the description I have added a separate script so that the resulting executable doesn't execute if the compilation fails. You can use that.
And double check that your program does, in fact, compile and it's in the right directory.
Also, that "new1" name might mean you're using temporary files, try saving the file somewhere and then compiling it
Instead of Nppexec it is coming NppExport after installing nppexec. Why?
You mean after installing nppexec? Double check you installed the right plugin
my script runs in cmd and closes at same time, I can't see the output
There's a trick to this. You can add a system("pause"); at the end of the source code or a getch()/getche()/getchar() (one of those should work)
@@CodeVault sir it's not working
You can also try a scanf at the end, if all else fails.
@@CodeVault not working
Here is the code reply me with the correct changes.
#include
int main()
{
int a,b;
printf("Enter the value of a
");
scanf("%d",&a);
printf("Enter the value of b
");
scanf("%d",&b);
printf("The sum of a and b is %d",a+b);
return 0;
}
Where did you add system("pause"); or getch()?
Sir can you explain vim configuration in windows and how to customise it to work with it better
I'm not too familiar with vim
Search vim caleb curry
Hi!! I am using the Notepad ++ text editor but it does not recognize the "src" and "url" in the
@ font-face of the css code to import custom fonts. What can I do to solve this problem?
Hmm, you're trying to edit CSS in Notepad++?
@@CodeVault The only problem that I have editing in css with Notepad ++ is that it does not recognize the SRC (source) and URL inside the @ font-face.
This is what I am writing in the css code of Notepad ++ text editor:
@font-face{
font-family: Piedra Regular;
src: url(E:\Diseño web\Fonts\Piedra-Regular.ttf);
}
h1{
font-family: Piedra Regular, cursive;
font-style: italic;
text-transform: uppercase;
}
h3{
font-family: Piedra Regular, sans-serif;
font-size: 34px;
font-weight: lighter;
}
Yeah, you can't specify absolute paths in CSS since this is ran in the browser. You'll need to specify relative paths to the CSS file (inside the webserver). So you'll have to copy the .ttf file in your source folder.
process started but not finishing ......please solve this problem
Hmm... I can't know what's wrong with just this information. Where does it hang?
@@CodeVault after creating s c compiler as shown in the video. we are unable to give any input in run time
only hello world type program works that means if any scanf function is present notepad console hangs there itself
@@parvati-putra Odd... I added in the description a different script you can run. Maybe that will work?
@@CodeVault yes sir i tried that too but the same problem!!
@CodeVault good evening, I would like to know from you with greater clarity; given my little programming experience, what use this script is, summing up in a few words.
npp_save
cd "$(CURRENT_DIRECTORY)"
cmd /c gcc -o "$(NAME_PART).exe" "$(FULL_CURRENT_PATH)" && "$(NAME_PART).exe
First line is for saving the current file. Second one just changes the current working directory to be the directory of the current file. Then the last one simply compiles the current file to a file that's named the same but with .exe extension.
I can't get it to run, I save the file and all that and it says that it can't find the file. Any ideas?
Odd, are you using the same execution code? Can you paste it here?
@@CodeVault I followed the steps in the video exactly; it did work the first time, but hasn't since
Hmm.. interesting. Make sure you're saving the file somewhere on your system as Notepad++ can retain unsaved files indefinitely
How'd you get the system properties?
Control Panel -> System -> Advanced system settings (somewhere on the right)
Why does it take so much time to give the result of the code?
It's just how much it takes to compile and run... C and C++ is notorious for slow compile times
@@CodeVault Ok thanks
thanks for video, it 's help full. Now i can compile C in notepad++ that 's wondenful
Thank you Sir!
Hey CodeVault, it seems the script that is using MinGW didn't stop when the compiling process hits a syntax error, but it would go on with the execution process as if no syntax errors were found! You can re-create a simple test by taking out a semicolon at the end of any statement (let say we do "return 0" rather than "return 0;"). In this case, the compiling process shouldn't go any further when it hits a syntax error. Please fix and update the script. Thanks!
I figured it out. Try this script instead:
npp_save
cd "$(CURRENT_DIRECTORY)"
cmd /c gcc -o "$(NAME_PART).exe" "$(FULL_CURRENT_PATH)" && "$(NAME_PART).exe"
Without running the command "cmd /c" each command line is ran completely separate, so there's no way of checking. Similarly with the Visual C one.
@@CodeVault It works! Very happy & Thank you so much for your help.
Were we will get system properties.i am unable to find it.plzz rply
Try right clicking on the start button, there should be a settings option there
maybe next time show your full screen. I don't know how you got your system properties menu.
Ah, my bad, just search for "environment variables" on the start menu and it should get you there.
How do you compile multiple files? For axample h. Files and cpp files
Header files (.h) you simply include in your source files (.c/.cpp). If you have multiple source files you could either expand the gcc command with more .c/.cpp files or use make/cmake for creating a script that compiles everything for you.
Something along the lines of:
gcc -o main.exe main.c src_print1.c src_print2.c
@@CodeVault Thank you so much!!!
where did you find system properties window
On Windows 10 it's a bit more cryptic:
Right click on "This PC" -> Properties -> (on the left sidebar) Advanced System Settings
Please make one for both c and c++
You should be able to use the exact same thing just g++ instead of gcc when compiling.
Please make a video on c++ also...in notepad++
It's basically the same thing. Just use g++ instead of gcc
Le système ne peut exécuter le programme spécifié
svp aide
This might have to do with your antivirus settings
muchas gracias
Hi, does anybody have a problem with "Operation did not complete successfully because the file contains a virus or potentially unwanted software." when trying this? I believe this Windows + MinGW combination problem, not Notepad (7.8.1) specific; versions are Windows 10 (Version 1909, OS build 18363.900), Mingw32-gcc-bin 9.2.0-1 ; BR
Odd... Looks like Windows Defender is at fault. Try disabling real time protection and see if that makes it work.
I think it sees the compiled executable as a threat.
@@CodeVault Hi, yes it looks like WIndows Defender, Virus & threat protection "feature, not bug". Way out is a) disable "Real-time protection" or better b) add "Exclusion folder" where exe is created. It is same behavior in shell and Notepad and VSCode, but not for example in CodeLight IDE (which I think also use MinGW). BTW, thanks for all these simple and great videos
Te llevas un zukulentoh like..!! Thanks a lot bruh..!!
"new 1.exe"
; about to start a child process: ""new 1.exe""
CreateProcess() failed with error code 2:
The system cannot find the file specified.
I got this on the console, I guess it should be something about the path????
Did you save the file? And did it compile successfully?
@@CodeVault well, no, I didn't. I deleted it and I executed a c file (coded on VSCode) with NppExec and the compiler didn't work well. However, when I run the same code on VSC it works fine, so I guess I did something wrong. I usually use VSC to code python because is very easy-to-use, and it works fine coding c on it.
Hmm, you need to save it, otherwise the compiler doesn't know where the file is (even if it exists in temp). You can certainly compile/debug/execute C code in VSCode too, there's a video I made on this topic: ua-cam.com/video/N5GhV8K8DIc/v-deo.html
@@Edvs3261 Hey man, could you solve the problem? I'm getting the same error and I think I did everything as explained xd
Well I kinda solved it, I just saved my .c file in C:\MinGW\bin
im not getting the C:\MinGW\bin
Either manually find it in ur c drive or u haven't installed it yet
amigo, se que hablas español, hazlo porfa :(
Thanks for the video, did exactly what you said, but am getting the error: C:/GCC/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot open output file g++.CharacterArrays.exe: Permission denied
There are some issues with permissions. I can't say for sure. But trying to run Notepad++ as admin might fix things