0

Currently I am working on project of Image processing using c++. I found solution which requires use of Command prompt.Can you please tell me syntax of some portion of it?

Since my C++ skills aren't that great I don't know how to achieve this.

4
  • stackoverflow.com/questions/8832326/… Commented Nov 8, 2016 at 12:32
  • what OS? some compiler/IDEs has linbuild functions to run cmd. You can always start new proccess with cmd.exe or what ever ... and then hook to its handle ... or use pipes etc Commented Nov 8, 2016 at 12:33
  • I am using windows 7 Commented Nov 8, 2016 at 12:37
  • It's unclear what you're asking here. Do you want to run a command? Do you want to run a command with a bunch of command line parameters? Do you want to pop up a command prompt window for the user to type in? Do you want to launch a command, pipe the results to a second command, and redirect those results to a file? Commented Nov 8, 2016 at 18:04

1 Answer 1

0

Try to use system() function:

#include <stdlib.h>

int main(void)
{
  return system("dir");
} 
Sign up to request clarification or add additional context in comments.

3 Comments

When I am writing following syntax return system("dir"); It refers to my desktop location.But I want this pointer to my C:/ drive.
I used "dir" as example. You can use any command promt instruction.
system("dir c:\\"); - lists C:/ drive

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.