//in java im used to things like this
public Detailclass{
String name;
int amount;
//parameterized constructor
public Detailclass(String name,int amount){
this.name=name;
this.amount=amount;
}
publicclass Main{
publicstaticvoid doSometing(String whatever,int anumber,Detailclass something){
//some code
}
publicstaticvoid main(String args[]){
//i could call the method like this
doSomething("hello",3,new Detailclass("hi",4));//is there some way to pass a to be constructed object as parameter in c++ ?
//i dont want to define that struct needed one line above, i want it to be created right in the functions signatur, that needs it as parameter
}//end main
}//end main class
It wasn't exactly what i'm looking for but i guess i answered the question myself with your help. I guess there is no such thing in C++, if there was, one wouldnt know how to free that memory, since the object would be created while passing to a function.