What i meant, i wanted to warn Dimitris that char[100] are just array of 100 characters (bytes in C).. and has nothing to do with strings. Do not confuse fixed-length C arrays with strings. There's no 'string' data type in C, and instead they use null-terminated character sequence as a convention. But it is not a fixed-size data. On 9 November 2016 at 02:38, Igor Stasenko <siguctua@gmail.com> wrote:
On 8 November 2016 at 14:42, Esteban Lorenzano <estebanlm@gmail.com> wrote:
(always with Char100 example in mind):
s := MyStructure fromHandle: blah. string := s data readString.
should work.
IIRC, #readString works correctly only for correctly null-terminated strings. If not, it will read beyond the structure size , until it find a zero byte somewhere in memory, and thus, results may vary :)
Esteban
On 8 Nov 2016, at 14:31, Dimitris Chloupis <kilon.alios@gmail.com> wrote:
I feel like stupid but I cannot find a way to convert an Array of Characters to a String , I can do with a do: and join characters converted to strings to a single string but it feels too many steps.
Is there a simpler way ?
-- Best regards, Igor Stasenko.
-- Best regards, Igor Stasenko.