这是我在运行程序时遇到的错误:
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_S
和avail_S
是结构。我在远程Visual Studio 2008上运行此程序。
struct avail_S
{
long off;
int size;
};
struct index_S
{
int key;
long off;
};
谢谢!