Can a struct have a constructor in C++?
struct
I have been trying to solve this problem but I am not getting the syntax.
struct TestStruct { int id; TestStruct() : id(42) { } };