C++ Visual Studio 2017 C++;控制台不输出所有内容

C++ Visual Studio 2017 C++;控制台不输出所有内容,c++,visual-studio-2017,C++,Visual Studio 2017,我在YouTube上观看一段关于哈希表的视频,在测试一些输出时,我意识到我的控制台跳过了好几行 所以我的哈希表最初的大小是10。当我运行程序时,一切都正常显示。但是,当我将大小增加到20时,我的控制台跳过了前3个索引。我不知道问题是否出在我的代码或Visual Studio上,但我希望这里的人会知道 这是尺寸为20的控制台输出的图片: 尺寸10: Hash::Hash(){ for(int i=0;iname=“empty”; HashTable[i]->drink=“empty”; 哈希表

我在YouTube上观看一段关于哈希表的视频,在测试一些输出时,我意识到我的控制台跳过了好几行

所以我的哈希表最初的大小是10。当我运行程序时,一切都正常显示。但是,当我将大小增加到20时,我的控制台跳过了前3个索引。我不知道问题是否出在我的代码或Visual Studio上,但我希望这里的人会知道

这是尺寸为20的控制台输出的图片:

尺寸10:

Hash::Hash(){
for(int i=0;iname=“empty”;
HashTable[i]->drink=“empty”;
哈希表[i]->next=NULL;
}
}
int Hash::hashFunction(std::string键){
int hash=0;
整数指数;
对于(int i=0;iname==“空”){
哈希表[index]->name=name;
哈希表[索引]->饮料=饮料;
}
否则{
item*ptr=哈希表[索引];
项目*n=新项目;
n->name=name;
n->饮料=饮料;
n->next=NULL;
while(ptr->next!=NULL){
ptr=ptr->next;
}
ptr->next=n;
}
}
int Hash::numItemsIndex(int索引){
整数计数=0;
if(哈希表[索引]->name==“空”)
返回计数;//0
否则{
计数++;
item*ptr=哈希表[索引];
while(ptr->next!=NULL){
计数++;
ptr=ptr->next;
}
}
返回计数;
}
void Hash::printTable(){
整数;
for(int i=0;icout此错误是由于您没有ntdll和所有其他文件的符号文件。您可以做些什么来避免此错误:-您可以有多个选项

下载microsoft提供的符号包。这将下载所有系统库的PDB。将其解压缩到“c:\symbolcache” 将符号路径设置为SRVc:\symbolcachehttp://msdl.microsoft.com/download/symbols. 在这种情况下,如果不存在,则将PDB文件下载到“c:\symbolcache”中。 然后,您必须将“c:\symbolcache”设置为您正在使用的任何崩溃转储分析工具的符号文件路径


对于此错误,您可以共享如何调用哈希的代码。

您的哈希函数不会为每个字符串生成唯一的数字,因此某些索引将重复。如果您打印每个字符串的索引,您可以看到这一点:

Paul, 0 
Kim, 3
Emma, 6 
Annie, 7
Sarah, 1
Pepper, 2 
Mike, 2 
Steve, 9
Bill, 9
Marie, 0 
Susan, 6 
Joe, 8

您需要一个更大的散列值范围来避免散列冲突。0..9的范围太小,几乎会与您当前的方法产生冲突。

这是调试器中可以看到的正常输出,与您的程序无关。您没有显示足够的代码,任何人都只能猜测您的问题。Pi输出的ctures不是必需的,也没有帮助,但生成该输出的代码是必需的。这是您的代码的问题。您尚未发布所有内容,因此无法说出错误的确切位置。请阅读。同时阅读您的代码并尝试一下。您的第二张图片显示了一个滚动条。没有人知道它隐藏了什么。请不要发布文本终端的图片,它们大多是无用的。请发布程序输出的实际文本(所有内容,而不仅仅是适合您窗口的内容).
无法找到或打开PDB文件。
只是表示您没有系统DLL的调试符号。除非您想调试这些符号,否则这不是问题。听起来0-9起作用,但0-19起作用,这似乎很奇怪。它们不必是唯一的,因为在发生冲突的情况下,保留一个列表似乎可以考虑到这种可能性。这是错误的虽然很可能存在bug,但如果不发明缺失的代码,就无法真正调试它。调试类似这样的东西的一种简单方法是让哈希函数始终返回0,以强制所有内容发生冲突,以及代码如何处理。 'LetsHash.exe' (Win32): Loaded 'C:\Users\Rohan Vidyarthi\Desktop\LetsHash\Debug\LetsHash.exe'. Symbols loaded. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\kernel32.dll' 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\vcruntime140d.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\WRusr.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ucrtbased.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcrt.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp140d.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\user32.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\win32u.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32full.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shell32.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\windows.storage.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\combase.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ucrtbase.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sspicli.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptbase.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\bcryptprimitives.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sechost.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\powrprof.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\advapi32.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shlwapi.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel.appcore.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\SHCore.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\profapi.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ole32.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\psapi.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ws2_32.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\oleaut32.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\wininet.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\oleacc.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp_win.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\urlmon.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\secur32.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msimg32.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\iertutil.dll'. Cannot find or open the PDB file. 'LetsHash.exe' (Win32): Loaded 'C:\Windows\SysWOW64\imm32.dll'. Cannot find or open the PDB file. The thread 0xbc8 has exited with code 252968960 (0xf140000). The thread 0x1700 has exited with code 0 (0x0). The thread 0x19bc has exited with code 0 (0x0). The thread 0x1b70 has exited with code 0 (0x0). The program '[3484] LetsHash.exe' has exited with code 0 (0x0).
Paul, 0 
Kim, 3
Emma, 6 
Annie, 7
Sarah, 1
Pepper, 2 
Mike, 2 
Steve, 9
Bill, 9
Marie, 0 
Susan, 6 
Joe, 8