0
Are arguments necessary for class functions or not?
I have seen examples which have arguments end some which do not even though the variables are in the class in both the cases
2 Respostas
+ 1
Arguments for class functions certainly aren't necessary for some examples. It all depends on what you want the function to do. Maybe you could post the examples you're asking or clarify why you want to know if it's necessary or not.
+ 1
Well technically, all class methods always have one parameter under the hood. A pointer to the class instance is passed into each method as the first parameter. (Your compiler does this for you)
But past that there doesnt need to be any other parameters, so it's up to you of course.