Y
Hacker News
new
|
ask
|
show
|
jobs
by
MrRadar
419 days ago
That's C++11 syntax. Before then you'd have to manually initialize them in every constructor, with a hand-written default constructor as a minimum:
struct test { int my_int; int *my_ptr; test() : my_int(0), my_ptr(NULL) {} };