Globbing in C++/C, on Windows

前端 未结 5 1836
礼貌的吻别
礼貌的吻别 2020-12-01 14:41

Is there a smooth way to glob in C or C++ in Windows?

E.g., myprogram.exe *.txt sends my program an ARGV list that has...ARGV[1]=*.txt in it.

5条回答
  •  暖寄归人
    2020-12-01 14:57

    Link with setargv.obj (or wsetargv.obj) and argv[] will be globbed for you similar to how the Unix shells do it:

    • http://msdn.microsoft.com/en-us/library/8bch7bkk.aspx

    I can't vouch for how well it does it though.

提交回复
热议问题