Invoking an EXE program in C + + to operate

Source: Internet
Author: User

#include <Windows.h>     //system头文件

#include <direct.h>        //_chdir头文件

#include <iostream>    //cout头文件

#define

usingnamespace std;   //cout 命名空间

void main()

{

?

char path[]="d:/vs/scene_text";   //指定cmd运行目录

if (_chdir(path)==0)

    {

for (int picIdx=1;picIdx<=picNum;picIdx++)

        {

char cmd_command[100];

            sprintf(cmd_command,"scenetext ./classifier1.txt ./imgs/%d.jpg ./results/",picIdx);   //将指令输入cmd_command字符串

            system(cmd_command);//执行指令

        }

?

    }

else

    {

        printf("指定的路徑不存在, 或是路徑錯誤!\n");

    }

?

}

??

#include <stdlib.h> / * System, NULL, Exit_failure * /

This header file can also be used to invoke these commands

Invoking an EXE program in C + + to operate

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.