how to wrap c scanf procedure in nim

2023-10-27 Thread janAkali
> I am interested in building something useful with nim, please could you make > a suggestion. The best option is to find something that bothers you in your daily routine. And try to fix, improve or to automate it. If you're still unsure, you can pick one of problems from public lists: *

how to wrap c scanf procedure in nim

2023-10-27 Thread isaiah
thanks it worked well.i am interested in building something usefull with nim.please could you make a suggestion. something not too hard and too easy.

how to wrap c scanf procedure in nim

2023-10-27 Thread cblake
Maybe being explicit here will help. So, proc scanf*(fmt: cstring): int {.importc, varargs.} var a, b, c: cint echo scanf("%d %d %d", a.addr, b.addr, c.addr) # 3 echo a # first 3 cints that echo b # user put into stdin echo c Run Save the above in a

how to wrap c scanf procedure in nim

2023-10-27 Thread PMunch
You will have to be more specific. What isn't working, what have you tried, etc.? It should be the same signature as a printf, so something like this should work: proc scanf(formatstr: cstring) {.importc: "scanf", varargs, header: "".} Run

how to wrap c scanf procedure in nim

2023-10-27 Thread isaiah
i been able to wrap printf, sqrt from math.h. but finding it difficult to wrap scanf.i will appreciate any help.