Boost logo

Boost Users :

Subject: Re: [Boost-users] A question about "prim_minimum_spanning_tree.hpp"
From: Gábor Szuromi (kukkerman_at_[hidden])
Date: 2010-08-27 12:00:48


You're allocating edges and weights on the stack:

E edges[num_edges];
int weights[num_edges];

This is not a good idea, because stack space is very limited compared
to the heap. Allocate these two vectors on the heap instead:

E *edges = new E[num_edges];
int *weights = new int[num_edges];


delete[] edges;
delete[] weights;


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at