for some bizarre reason I always forget the exact syntax of arrays. How do I create an array in the header and initialise it in the constructor? Is it possible to initialise it in the header as well as defining it?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I have since read up on this issue a little more and it seems it is not possible: This actually hits on one of the shortcomings of the C++ language — there is no way to initialize non-static array members in C++.