lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

> [...] if you declare i as int IN the function f, like:
> void f (void) {
>   int i;
>   i = i+1;
> }
> then i is local. [...]

> And this is why I was surprised, that I have to "declare" a variable as
> local in the body of a function.

What you said is:

"In C, if I declare a variable in the function, then it's local. That's why 
 I was surprised that in Lua I have to declare a variable in the function so
 that it's local."

Do you mean it? :-)

-- Cassino