Avoid using a dynamic array as it causes problems in VC++