
1 Aug
2013
1 Aug
'13
2:05 p.m.
Sladey wrote
Problem I have is seem to be able to allocate the memory but i can't change or access any of the elements.
#include <iostream> #include "boost/multi_array.hpp"
typedef boost::multi_array<int, 2> array_type;
int main() { array_type *A = new array_type;
A->resize( boost::extents[2][2] );
A[1][1] = 2;
std::cout << A[1][1] << std::endl;
delete A;
return 0; }
Try: (*A)[1][1] = 2; and std::cout << (*A)[1][1] << std::endl; Dan Searles -- View this message in context: http://boost.2283326.n4.nabble.com/Storing-path-from-A-using-operator-new-wi... Sent from the Boost - Users mailing list archive at Nabble.com.