Hey!
I'm testing out some things in terra, one of the first things I wanted
to try was calling C functions. So I did:
``` terra
CIO = terralib.includec("stdio.h")
for i = 0,10 do
CIO.printf("Oh you grow so fast, you are now %d years old!!\n", i)
end
```
However, the output was not quite what I expected, what I get is this
```
% terra test.t
Oh you grow so fast, you are now 0 years old!!
Oh you grow so fast, you are now 0 years old!!
Oh you grow so fast, you are now 0 years old!!
Oh you grow so fast, you are now 0 years old!!
Oh you grow so fast, you are now 0 years old!!
Oh you grow so fast, you are now 0 years old!!
Oh you grow so fast, you are now 0 years old!!
Oh you grow so fast, you are now 0 years old!!
Oh you grow so fast, you are now 0 years old!!
Oh you grow so fast, you are now 0 years old!!
Oh you grow so fast, you are now 0 years old!!
```
It's not the loop that is the problem either, when I do something like
``` CIO.printf("%d\n", 81) ``` it also prints 0 instead of the number
passed in. Anyone got a clue what might be wrong?
This is using Mac OS X 10.10.2
Thanks!
_______________________________________________
terralang mailing list
[email protected]
https://mailman.stanford.edu/mailman/listinfo/terralang