From: Michael H. <mhe...@ya...> - 2005-07-30 01:15:31
|
I'm getting a segmentation fault when trying to assign a Cell array to an Octave_map object, and I don't quite understand why. What is the appropriate way to insert a cell array into an Octave_map? Below is some sample code and the results I get. Thanks in advance, Mike ------------------------------------------------------------- #include <oct.h> #include <ov-cell.h> #include <ov-struct.h> #include <string> using namespace std; DEFUN_DLD(testoctave, args, nargout, "Play around with stuff."){ Octave_map tstruct; octave_cell cellnames; message("1","Before cell assignment"); cellnames.assign(octave_value(1),octave_value("fred")); cellnames.assign(octave_value(2),octave_value("wilma")); message("2","Before struct 'couple' assignment"); tstruct.assign("couple","Flintstones"); message("3","Before struct 'names' assignment"); tstruct.assign("names",cellnames); message("4","After struct 'names' assignment"); octave_value_list retval; return retval; } ------------------------------------------------------------- The results look like this: 1: Before cell assignment 2: Before struct 'couple' assignment 3: Before struct 'names' assignment panic: Segmentation fault -- stopping myself... attempting to save variables to `octave-core'... save to `octave-core' complete Segmentation fault |