RosettaCodeData/Task/Use-another-language-to-call-a-function/Nim/use-another-language-to-call-a-function-1.nim
2023-07-01 13:44:08 -04:00

9 lines
224 B
Nim

proc Query*(data: var array[1024, char], length: var cint): cint {.exportc.} =
const text = "Here am I"
if length < text.len:
return 0
for i in 0 .. text.high:
data[i] = text[i]
length = text.len
return 1