0

I want to run a cmd program through my C app and be able to get input and send output to the cmd. can I do such a thing?

thanks.

adi ohaion
  • 374
  • 6
  • 21

1 Answers1

0

The function you're looking for is system(cmd). You can run the command normal (output will be directly printed to the screen):

system("command.exe");

Or capture the output (stdout) in a file:

system("command.exe > file.txt");
qwertz
  • 14,614
  • 10
  • 34
  • 46