By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,512 Members | 1,805 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,512 IT Pros & Developers. It's quick & easy.

std::vector resize crash

P: n/a
Hi,

When I attempt to resize a column in a 2d vector I receive the error listed
below. I'm using the libraries supplied with VxWorks.

0xf3fe450 (tExcTask): memPartFree: invalid block 0xf340ef0 in partition
0x311b8c

Here is the example code I'm using to produce the error. Any idea's what is
wrong with the code?

#include <vector>

using namespace std;
using std::vector;

void main(void)
{
std::vector< std::vector<int> > triangle(5);

for(int i = 0; i < triangle.size(); i++)
{
triangle[i].resize(i+1);
}
}

Thanks in advance,

Daniel.
Oct 26 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Daniel J Watkins wrote:
Hi,

When I attempt to resize a column in a 2d vector I receive the error
listed
below. I'm using the libraries supplied with VxWorks.

0xf3fe450 (tExcTask): memPartFree: invalid block 0xf340ef0 in partition
0x311b8c

Here is the example code I'm using to produce the error. Any idea's what
is wrong with the code?

#include <vector>

using namespace std;
using std::vector;

void main(void)
int main (void)
{
std::vector< std::vector<int> > triangle(5);

for(int i = 0; i < triangle.size(); i++)
{
triangle[i].resize(i+1);
}
}


Everything else is fine.

I have no idea about this VxWorks thing. But if you think it detects an
error, maybe you are using an outdated compiler that uses a buggy
implementation of std::vector. The fact that it accepts void main ( void )
may hint in that direction, too.
Best

Kai-Uwe Bux

Oct 26 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.