On 2020-03-27 13:00,
giahung1997tn@gmail.com wrote:
I want to interface with C code whose return a C string which is an
array of char. I found it to be impossible. >
So I tried to declare a new type as array of char but it is impossible, too.
To last resort I tried to declare a new type as pointer to char, then
it is impossible too as the compiler will not allow pointer to non
record type.
I stuck at this stage because if I can't write the declaration module
in Oberon how could I go further to do the actual implementation in C
source file?
In Oberon, strings are returned as output parameters; i.e. variable
parameters of type ARRAY OF CHAR. Therefor you need to adjust the
signature of the procedure accordingly.
Oberon is viewed as a compact and beautiful language but if it's too
limited like that it's too useless for any practical purpose other
than an academic research project.
Why do you use it then?
-- August
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)