The var is a bit like auto in c++
var x=0.0, x is double
var y=6, y is integer
var s="Hello",s is string.
The #define is a macro, I could have made map a function, but the macro behaves like a function (with care), inlined, and it is more compact.
Because I have used the division (/) inside #map() the result of map is a double.
Any parameters sent to #map should be bracketed if they are not simple
map((2+3),(6+9),x,0,5)
Or I could have put all the brackets inside the macro, which is really the proper way.
Initalising multi-dimentional arrays with muiltiple values
-
- Posts: 44
- Joined: Nov 07, 2019 21:57
Re: Initalising multi-dimentional arrays with muiltiple values
I see, How peculiar and efficient! Thank you for the deep explanation, I hope to benefit from this greatly.dodicat wrote:The var is a bit like auto in c++
var x=0.0, x is double
var y=6, y is integer
var s="Hello",s is string.
The #define is a macro, I could have made map a function, but the macro behaves like a function (with care), inlined, and it is more compact.
Because I have used the division (/) inside #map() the result of map is a double.
Any parameters sent to #map should be bracketed if they are not simple
map((2+3),(6+9),x,0,5)
Or I could have put all the brackets inside the macro, which is really the proper way.