Domanda

I compile and run many .c files in notepad++ using this code

NPP_SAVE
g++.exe -g "$(FULL_CURRENT_PATH)" 
a

Now what I want is that each time after compilation and running, an input is also sent to the program. Something like below

NPP_SAVE
g++.exe -g "$(FULL_CURRENT_PATH)" 
a
28 10 1985 //this is the input to the program a

I have a lot of .c files to check if they give correct output when provided a date.

È stato utile?

Soluzione

The solution to redirect input from file using nppexec is to use cmd

cmd /c g++ -o $(NAME_PART).exe $(FILE_NAME) && $(CURRENT_DIRECTORY)\$(NAME_PART).exe < input.txt
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top