Reputation:
I would like to know how to increase variables in Nim by 1, alike the (variablename)++
function in other programming languages.
My Code by far:
int i = 1
int j = 1
for i in countup(1, 10):
j = j + 1
echo "number: "
echo i
I want to change the j = j + 1
with the Nim version of: j++
Upvotes: 3
Views: 867
Reputation: 101
You can increment a variable by one in Nim with the inc()
function: inc(var_name)
Upvotes: 4