Hello, I am new to Nim and I am trying to read a string similar to C++
string s;
cin >> s;
So far, I have tried the following which is not correct:
proc scanf(frmt: cstring) {.varargs, importc, header: "<stdio.h>".}
var s: cstring # Not sure how to allocate it properly so that it is garbage collected
scanf("%s", s);
Do you have any suggestions how to make this work or is there a better way to accomplish something like that? Thank you very much!You don't have to resort to C interop for this, Nim has basic IO functionality by default ;)
let line = readLine()