Passing multiple parameters into function. How?
-
Hello all?
What is best way in Qt to pass into function multiple parameters? For example I have an issue to create object that might be required in one case 3 properties and in another case 30 properties. In Java Script this case looks like passing into function named array where key-value pairs. I need something like it for CPP.
-
Hello all?
What is best way in Qt to pass into function multiple parameters? For example I have an issue to create object that might be required in one case 3 properties and in another case 30 properties. In Java Script this case looks like passing into function named array where key-value pairs. I need something like it for CPP.
-
@bogong
you can use in c++ a list/vector of key value pairs as well.
But I think you're better off using a class/struct as parameter. -
@J.Hilk Thanks a lot. I've been already using list/vector. Is there any example of class/struct?
@bogong
take a look in this thread,it should get you going ;-)
https://stackoverflow.com/questions/15181765/passing-structs-to-functions -
@bogong
take a look in this thread,it should get you going ;-)
https://stackoverflow.com/questions/15181765/passing-structs-to-functions -
@J.Hilk I-I-I-H-A-A-A! That's what I've been seeking for! :-))))) I forget the key word - struct. I've been seeking: array, vectors and others but not "struct". Thanks ... Bad morning ... Need coffee ...