S
stephen b
(apologies for cross posting from the moderated group..i'm sure you
understand)
Hello, I'm passing an array into a Constructor and hoping to use it
as
a pointer and store it as a class member for future use. So far, I'm
just causing crashes, psuedo code below:
double block[8192];
foo = MyClass(block);
////
MyClass {
public:
MyClass (double *blk) {// constructor
inBlk = blk;
}
Process {
// this method will be called periodically and
// iterate over array pointed to by inBlk
// ..which causes a crash
}
private:
double *inBlk;
}
I imagine I'm doing something stupid that I just can't see at the
moment. How might one solve this? Perhaps ideally I should create
the array within MyClass but I don't really want to right now.
Thanks
for any help,
Stephen.
understand)
Hello, I'm passing an array into a Constructor and hoping to use it
as
a pointer and store it as a class member for future use. So far, I'm
just causing crashes, psuedo code below:
double block[8192];
foo = MyClass(block);
////
MyClass {
public:
MyClass (double *blk) {// constructor
inBlk = blk;
}
Process {
// this method will be called periodically and
// iterate over array pointed to by inBlk
// ..which causes a crash
}
private:
double *inBlk;
}
I imagine I'm doing something stupid that I just can't see at the
moment. How might one solve this? Perhaps ideally I should create
the array within MyClass but I don't really want to right now.
Thanks
for any help,
Stephen.