C++ 通过包含/排除设置禁用加载
我使用VisualStudio2010。 现在我正在测试一个从文件加载数据的过程。 出了点问题,我不记得编译器为什么生气。 不管怎样,现在我的程序根本没有执行, 这似乎被忽视了 我明白了:C++ 通过包含/排除设置禁用加载,c++,visual-studio-2010,visual-c++,C++,Visual Studio 2010,Visual C++,我使用VisualStudio2010。 现在我正在测试一个从文件加载数据的过程。 出了点问题,我不记得编译器为什么生气。 不管怎样,现在我的程序根本没有执行, 这似乎被忽视了 我明白了: 'coursework.exe': Loaded 'C:\Users\Гость\Documents\Visual Studio 2010\Projects\coursework\Debug\coursework.exe', Symbols loaded. 'coursework.exe': Loaded '
'coursework.exe': Loaded 'C:\Users\Гость\Documents\Visual Studio 2010\Projects\coursework\Debug\coursework.exe', Symbols loaded.
'coursework.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
'coursework.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
'coursework.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
'coursework.exe': Loaded 'C:\Windows\SysWOW64\msvcr100d.dll', Symbols loaded.
'coursework.exe': Loaded 'C:\Windows\SysWOW64\msvcp100d.dll', Symbols loaded.
'coursework.exe': Loaded 'C:\Windows\SysWOW64\apphelp.dll', Cannot find or open the PDB file
'coursework.exe': Loaded 'ImageAtBase0x4aa50000', Loading disabled by Include/Exclude setting.
'coursework.exe': Unloaded 'ImageAtBase0x4aa50000'
'coursework.exe': Loaded 'ImageAtBase0x49fe0000', Loading disabled by Include/Exclude setting.
'coursework.exe': Unloaded 'ImageAtBase0x49fe0000
我试图查看调试器选项,但没有修复任何问题
现在我有了一个想法,杀死调试目录中的所有文件。与sln文件位于同一文件夹中的文件。嗯,cpp文件所在的另一个调试目录
我说得对吗?我是否选择了正确的调试目录(其中有3个文件:exe、ilk、pdb)
后来添加
这是一个摘录,似乎已经引起了问题
ifstream myfile ("grablevskij.txt");
delete[] pointer;
AR_POINT ar_point = {NULL, 0, 0};
POINT * tmp_point = new POINT();
if (myfile.is_open())
{
string line;
while (myfile.good() )
{
getline (myfile, line);
int x_first = line.find('(') + 1;
int x_last = line.find(',') - 1;
string x_substr = line.substr(x_first, x_last);
int tmp_x = atoi(x_substr.c_str());
int y_first = line.find(',') + 1;
int y_last = line.find(')') - 1;
string y_substr = line.substr(y_first, y_last);
int tmp_y = atoi(y_substr.c_str());
ar_point.occup++;
(*tmp_point).id = ar_point.occup;
(*tmp_point).x = tmp_x;
(*tmp_point).y = tmp_y;
ar_point.p = new_point(ar_point.p, tmp_point, ar_point.occup);
}
}
是`delete[]指针;`只是这段代码之前属于某个代码的随机行?它不属于属于C++的代码片段。当我从文件加载数据时,我想删除所有的数据。好的,公平的,在这个地方看起来有点随机,因为在发布的代码中没有其他的“指针”。说实话,这让我有点担心。使用新操作符,我生成了一些点结构。它们位于堆中的某个地方。新返回*点。我维护指向指针的指针数组,以将信息保存在我的点所在的位置。当我想要加载文件时,我会确保用户确实想要替换现有数据。然后我删除指向指针的指针数组。这是delete[]指针(指针是**点)。但困扰我的是,我的所有点结构是否仍保留在堆中。你能给我一些建议吗?如果你能看到更多的代码,我会很有帮助的。。。