V
Varun Kacholia
Hi everyone,
I have the following piece of code:
vector<MyClass*> my_vector(10, NULL);
However this throws the following errors:
myfile.cc: warning: converting NULL to non-pointer type
stl_algobase.h: In function `class MyClass ** fill_n<MyClass **, int,
int>(MyClass **, int, const int &)':
While I understand the reasons for fill_n craping out (as it is not
able to get a pointer to the NULL value
passed by me), is there a way to initialize vector with NULLs? Or is it
safe to assume that vectors
will be initialized with NULLs? thanks!
I have the following piece of code:
vector<MyClass*> my_vector(10, NULL);
However this throws the following errors:
myfile.cc: warning: converting NULL to non-pointer type
stl_algobase.h: In function `class MyClass ** fill_n<MyClass **, int,
int>(MyClass **, int, const int &)':
While I understand the reasons for fill_n craping out (as it is not
able to get a pointer to the NULL value
passed by me), is there a way to initialize vector with NULLs? Or is it
safe to assume that vectors
will be initialized with NULLs? thanks!