1

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.

SMUsamaShah
  • 7,677
  • 22
  • 88
  • 131
  • 1
    I have similar problem. I would like to redirect input from a file e.g., "input.txt" as the standard input. I tried using "java $(NAME_PART) < input.txt" and it does not work. – Denny Dec 25 '12 at 13:48
  • looks like redirection does not work with nppexec as far as I have tried. – SMUsamaShah Dec 26 '12 at 06:34

1 Answers1

2

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
Denny
  • 143
  • 4