1. <i id='0OxbI'><tr id='0OxbI'><dt id='0OxbI'><q id='0OxbI'><span id='0OxbI'><b id='0OxbI'><form id='0OxbI'><ins id='0OxbI'></ins><ul id='0OxbI'></ul><sub id='0OxbI'></sub></form><legend id='0OxbI'></legend><bdo id='0OxbI'><pre id='0OxbI'><center id='0OxbI'></center></pre></bdo></b><th id='0OxbI'></th></span></q></dt></tr></i><div id='0OxbI'><tfoot id='0OxbI'></tfoot><dl id='0OxbI'><fieldset id='0OxbI'></fieldset></dl></div>

      <small id='0OxbI'></small><noframes id='0OxbI'>

      <tfoot id='0OxbI'></tfoot>

      1. <legend id='0OxbI'><style id='0OxbI'><dir id='0OxbI'><q id='0OxbI'></q></dir></style></legend>

          <bdo id='0OxbI'></bdo><ul id='0OxbI'></ul>
      2. 将输入管道输入到 C++ 程序中以在 Visual Studio 中进行调试

        时间:2023-06-04
          1. <small id='oKZvF'></small><noframes id='oKZvF'>

              <tbody id='oKZvF'></tbody>

              <bdo id='oKZvF'></bdo><ul id='oKZvF'></ul>

                1. <legend id='oKZvF'><style id='oKZvF'><dir id='oKZvF'><q id='oKZvF'></q></dir></style></legend>

                  <i id='oKZvF'><tr id='oKZvF'><dt id='oKZvF'><q id='oKZvF'><span id='oKZvF'><b id='oKZvF'><form id='oKZvF'><ins id='oKZvF'></ins><ul id='oKZvF'></ul><sub id='oKZvF'></sub></form><legend id='oKZvF'></legend><bdo id='oKZvF'><pre id='oKZvF'><center id='oKZvF'></center></pre></bdo></b><th id='oKZvF'></th></span></q></dt></tr></i><div id='oKZvF'><tfoot id='oKZvF'></tfoot><dl id='oKZvF'><fieldset id='oKZvF'></fieldset></dl></div>
                2. <tfoot id='oKZvF'></tfoot>
                3. 本文介绍了将输入管道输入到 C++ 程序中以在 Visual Studio 中进行调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  之前可能有人问过这个问题,但到目前为止我还没有找到任何答案.我正在尝试使用多行输入启动我的程序,即我不想每次都在命令行中输入一些东西(因为我可能会犯错误).我查看了命令行参数并将我的输入粘贴到那里,但它把它解释为每一行都是一个命令.

                  this has probably been asked before, but I haven't been able to find any answers so far. I'm trying to start my program up with multi-line input, I.E. something I don't want to type in the command line every time (as I'd probably make a mistake). I looked into the command line arguments and I pasted my input in there, but it interpreted it as every line being a command.

                  输入以防万一:

                  8
                  c j i b s x k j
                  t a o a v y z l
                  x r t s w o n m
                  z y x e n s p r
                  l l o b s t e r
                  t g x a a a a a
                  j p e l a k e k
                  t r s l j e e e
                  cat
                  test
                  baseball
                  bake
                  paste
                  lobster
                  stake
                  zen
                  locks
                  rake
                  gel
                  slack
                  jar
                  dinosaur
                  0
                  

                  推荐答案

                  将数据放入文件中,然后转到 Visual Studio 中的项目属性并选择调试"类别.

                  Put your data in a file then go to the project properties in Visual Studio and select the "Debugging" category.

                  在命令参数"属性类型中:

                  In the "Command Arguments" property type:

                  < "path/to/the/file"
                  

                  现在,当调试器启动或使用 Ctrl-F5 在 Visual Studio 中(但没有调试器)启动程序时,该文件将通过标准输入提供给程序.

                  Now that file will be fed to the program via standard input when the debugger is launched or when you launch the program within Visual Studio (but without the debugger) using Ctrl-F5.

                  如果希望测试文件随项目一起移动,可以使用VS宏来指定项目目录等.

                  You can use VS macros to specify the project directory, etc. if you want the test file to move along with the project.

                  这篇关于将输入管道输入到 C++ 程序中以在 Visual Studio 中进行调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:C++:如何检查 cin 缓冲区是否为空? 下一篇:重置cin流状态C++

                  相关文章

                    <legend id='K21E1'><style id='K21E1'><dir id='K21E1'><q id='K21E1'></q></dir></style></legend>

                      <tfoot id='K21E1'></tfoot>
                    1. <small id='K21E1'></small><noframes id='K21E1'>

                      • <bdo id='K21E1'></bdo><ul id='K21E1'></ul>

                    2. <i id='K21E1'><tr id='K21E1'><dt id='K21E1'><q id='K21E1'><span id='K21E1'><b id='K21E1'><form id='K21E1'><ins id='K21E1'></ins><ul id='K21E1'></ul><sub id='K21E1'></sub></form><legend id='K21E1'></legend><bdo id='K21E1'><pre id='K21E1'><center id='K21E1'></center></pre></bdo></b><th id='K21E1'></th></span></q></dt></tr></i><div id='K21E1'><tfoot id='K21E1'></tfoot><dl id='K21E1'><fieldset id='K21E1'></fieldset></dl></div>