Declare class variable to call advanced constructor

Is is possible to declare variable to be able call constructor (e.g. with parameter), of course parameter somehow should be pointed out within declaration.
Yes, every variable made, automatically calls a constructor for that particular class, and maybe that for base classes too.
Base- no, only within inheritance. Maybe you understand my question wrong. I need to declare variable not in heap (via new operator) but do it statically
e.g.
static TVectorNeighbs<27> vnb;

The problem is TVectorNeighbs constructor has parameter i should point out in within declaration.
icegood wrote:
Base- no, only within inheritance

Yeah forgot to add that but that's what I meant. How can a class be called "base" when nothing inherits from it??
I think maybe you're looking for this?

1
2
3
4
5
// maybe what you're looking for?
SomeClass object(15);  // <- calling a constructor that takes a param

// similar call with new:
SomeClass* object = new SomeClass(15);
Thanks, Dish. That what i exactly want.
Topic archived. No new replies allowed.