I'm pretty new to programming and can't really understand why I can't just declare argument types the same way I do with normal variables and have to declare the type again and again.
I mean, why must I:
Func(int a, int b, float c)
instead of
Func(int a, b, float c)
?
As long as they're the same type, of course.
- Can I actually do that and just don't know how to?
If it is possible, please tell me how.
Thanks in advance.
@0x499602D2: If parameter declarations were more closely analagous to object declarations, then void f(int a, float c, d) would presumably be equivalent to void f(int a, float c, float d). The language could have made this work correctly and consistently. It just didn't. – Keith Thompson
This answered my question best. but it's a comment...