Tue 03 Jul 2012 04:01:48 PM UTC, original submission:
Hello,
I encounter memory access problems with Matrix in oct files with octave versions > 3.4.3.
For example, the following code works with octave 3.4.3, but fails with octave 3.6.2.
[built with 'CXXFLAGS=-O2 mkoctfile inspect.cc' on MacOS 10.6.8]
Is this a bug or am I wrong (I have read the docs, the forums, and this code is quite simple...)?
Thanks in advance.
Best regards,
Sylvain.
--
#include <octave/oct.h>
#include <octave/parse.h>
#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <string.h>
using namespace std;
DEFUN_DLD (inspect, args, , "inspect")
{
Matrix signal = Matrix (1,2);
signal(0) = 123.456;
cout << "Will be displayed..." << endl;
cout << signal(0) << endl;
cout << "Will NOT be displayed on recent Octave versions..." << endl;
return octave_value(0);
}
// End Of File
|