[vtkusers] std::string from vtkStringArray seg faults

Oliver Cairncross op.cairncross at gmail.com
Mon Aug 8 06:24:44 EDT 2016

The following code causes a seg fault

string s = sourceArray->GetValue(0);
cout << s << endl;

this is also a seg fault

string * s = &sourceArray->GetValue(0);
cout << *s << endl;


vtkStdString * s = sourceArray->GetValue(0);
cout << *s << endl;

does not.

What am I miss understanding about getting strings out of a string array?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160808/99bda0dc/attachment.html>

More information about the vtkusers mailing list