gpt4 book ai didi

c++ - eclipse CDT : passing multiple program arguments with same file extension

转载 作者:行者123 更新时间:2023-11-30 03:31:40 25 4
gpt4 key购买 nike

我想从同一个文件夹中输入一堆图像文件,并在 for 循环中对它们应用相同的操作。我将 main 定义为 int main(int argc, char** argv) 有这个 for 循环:

for(int i=1; i < argc; ++i)
{
// do something here
}

在 Eclipse CDT (Neon) 中,在运行配置 > 参数下,我正在输入我想要处理的图像的路径。当我明确给出像 img1.jpg img2.jpg ... 这样的图像列表时它会起作用但是当我尝试在具有特定扩展名的所有图像文件上运行它时它不起作用作为 dataset/*.jpg

有解决办法吗?谢谢。

最佳答案

Is there a workaround for this?

想到的两个最明显的是:

  1. 从终端而不是从 Eclipse 内部运行程序。
  2. 修改程序以仅将目录名称作为参数,并让它遍历目录中的文件。

关于c++ - eclipse CDT : passing multiple program arguments with same file extension,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44029159/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com