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.

2
  • 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. Commented Dec 25, 2012 at 13:48
  • looks like redirection does not work with nppexec as far as I have tried. Commented Dec 26, 2012 at 6:34

1 Answer 1

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
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.