<legend id='7Wnjb'><style id='7Wnjb'><dir id='7Wnjb'><q id='7Wnjb'></q></dir></style></legend>
      <bdo id='7Wnjb'></bdo><ul id='7Wnjb'></ul>
  • <i id='7Wnjb'><tr id='7Wnjb'><dt id='7Wnjb'><q id='7Wnjb'><span id='7Wnjb'><b id='7Wnjb'><form id='7Wnjb'><ins id='7Wnjb'></ins><ul id='7Wnjb'></ul><sub id='7Wnjb'></sub></form><legend id='7Wnjb'></legend><bdo id='7Wnjb'><pre id='7Wnjb'><center id='7Wnjb'></center></pre></bdo></b><th id='7Wnjb'></th></span></q></dt></tr></i><div id='7Wnjb'><tfoot id='7Wnjb'></tfoot><dl id='7Wnjb'><fieldset id='7Wnjb'></fieldset></dl></div>
      <tfoot id='7Wnjb'></tfoot>

        <small id='7Wnjb'></small><noframes id='7Wnjb'>

      1. 如何知道导致异常的确切代码行?

        时间:2023-08-03

        <small id='5Nymi'></small><noframes id='5Nymi'>

            <legend id='5Nymi'><style id='5Nymi'><dir id='5Nymi'><q id='5Nymi'></q></dir></style></legend><tfoot id='5Nymi'></tfoot>
              <tbody id='5Nymi'></tbody>

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

                  <bdo id='5Nymi'></bdo><ul id='5Nymi'></ul>
                  本文介绍了如何知道导致异常的确切代码行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  如果我自己生成异常,我可以在异常中包含任何信息:代码行数和源文件名称.像这样:

                  If I generate an exception on my own, I can include any info into the exception: a number of code line and name of source file. Something like this:

                  throw std::exception("myFile.cpp:255");
                  

                  但是未处理的异常或非我生成的异常怎么办?

                  But what's with unhandled exceptions or with exceptions that were not generated by me?

                  推荐答案

                  似乎每个人都在努力改进您的代码以在您的代码中抛出异常,而没有人尝试解决您提出的实际问题.

                  It seems everyone is trying to improve your code to throw exceptions in your code, and no one is attempting the actual question you asked.

                  那是因为做不到.如果引发异常的代码仅以二进制形式呈现(例如在 LIB 或 DLL 文件中),那么行号就消失了,并且无法将对象连接到源代码中的一行.

                  Which is because it can't be done. If the code that's throwing the exception is only presented in binary form (e.g. in a LIB or DLL file), then the line number is gone, and there's no way to connect the object to to a line in the source code.

                  这篇关于如何知道导致异常的确切代码行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:C++ catch 块 - 按值或引用捕获异常? 下一篇:为什么要保守地使用异常?

                  相关文章

                  最新文章

                • <tfoot id='8tBFI'></tfoot>

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

                      <small id='8tBFI'></small><noframes id='8tBFI'>

                      • <bdo id='8tBFI'></bdo><ul id='8tBFI'></ul>
                      <legend id='8tBFI'><style id='8tBFI'><dir id='8tBFI'><q id='8tBFI'></q></dir></style></legend>