Suppose I have have a Car.h
which define a class called Car , and I have implementation Car.cpp which implement my class Car
, for example my Car.cpp
can be :
struct Helper { ... };
Helper helpers[] = { /* init code */ };
Car::Car() {}
char *Car::GetName() { .....}
What is the life time of the helpers array ?
Do I need say static Helper helpers[];
?
If I have done some bad practices, please let me know.