From: "Glenn M. Lewis" Date: 2003-02-18T16:55:08+09:00 Subject: Question about SWIGing a C++ array for Ruby I've got these C++ classes: class CSITick { public: unsigned long date; float open; float high; float low; float close; long volume; }; class CSIChart { public: CSITick* getTick(long date); // CAN return NULL!!! CSITick* ticks; long numticks; //... }; where 'ticks' is an array of CSITick's, created with: ticks = new CSITick[numticks]; I can't seem to figure out how to make SWIG access this 'ticks' pointer as if it were an Array in Ruby, with length equal to numticks. I would like it to be read-only as well. The '%typemap' SWIG directive doesn't seem right, as this is the only place where I want to treat a CSITick* as an Array... otherwise, I would like a CSITick* to just be a reference to an instance of CSITick. Am I making any sense? I'm using SWIG-1.3.17 and ruby 1.6.8 (2002-12-24) [i586-mswin32] on Windows XP. Thanks! -- Glenn Lewis