未处理的类型'System.AccessViolationException'的异常

时间:2011-09-24 01:33:11

标签: c++ visual-studio-2008 unhandled-exception

这是我在运行程序时遇到的错误:

An unhandled exception of type 'System.AccessViolationException' occurred in test.exe

Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

以下陈述可能是问题吗?

int max_index=100;               
int max_avail=100;
vector<index_S> vec_index(max_index);       
vector<avail_S> vec_avail(max_avail); 

在上面的代码中,index_Savail_S是结构。我在远程Visual Studio 2008上运行此程序。

struct avail_S   
{
  long off;    
  int size;    
};

struct index_S     
{
  int key;     
  long off;    
};

谢谢!

0 个答案:

没有答案