使用子字符串构造函数构建字符串 - 调试 - 当自动跳过代码时
Building string using substring constructor- debugging - when step over code continues automatically?
我有以下代码:
//Open a file
//Put contents in to a char array
char* current_bytes = static_cast<char*>(region->get_address());
//Create a string
std::string my_string(current_bytes, x, 16);
x
= 202
current_bytes
包含 100,000,000 字节
当我调试(在 Visual Studio 中的调试模式下)并且我跳过字符串构造函数时,代码会自动继续??
我确实认为这可能是因为我在堆栈上创建了字符串,所以我尝试了这个:
std::string my_string = new std::string(current_bytes, x, 16);
但这也做了同样奇怪的事情,当我在调试模式下跨过它时,代码会自动继续......
为了使用 VS 调试构造函数,您需要在其中设置一个断点,否则它将继续。
相关文章:
- 编译包含字符串的代码时遇到问题
- 为什么这个 c++ 代码打印出长度 5,当我打印出字符串时,程序会自动终止?
- 我应该如何修改此代码以使用给定字符串中的字母打印菱形图案
- 我无法在 qt 的C++代码中定义字符串
- 从 C 样式字符串中删除子字符串 "in place" 在C++代码中
- 有人可以解释一下这段代码如何能够反转字符串
- 如何在 c++ 非托管代码中反序列化 byte[] 的 json 字符串?
- 我遇到了这个代码片段,不明白. 它递归检查 C++ 字符串中是否存在大写字符
- 如何用符合C++核心准则的代码替换C风格的字符串解析
- C++/CLI访问字符串::来自非CLI代码的格式
- MSVC UTF8字符串编码使用了不正确的代码点
- C++指向对象的指针堆数组中,如何将字符串传递给特定对象?有一些代码请看一下:
- 将浮点数转换为字符串时如何加快此代码的速度?
- C++代码,用于在用户插入的字符串的每个元音之后插入一对字符
- 如何获取包含 NULL 字符的外壳代码字符串的长度
- 字符串代码不起作用
- C++字符串代码点和代码单元的任何良好解决方案
- 输入验证,需要数字,而不是字符串.代码导致无限循环
- 使用引用传递方法的反向字符串代码不起作用
- 这个反向字符串代码正确吗