In Java, I would do this:
or in C#, I would do this:Code:public interface Date { public static final String[] month = { "January", "February", "March", etc etc}; }
How do I achieve this in C++? Like, are there static, const, etc? I promise I'd read the FAQs first, but if only I had a bit more timeCode:public class Date { // you can't have an array of const strings in C# public readonly static string[] month = { "January", "February", "March", etc etc}; }
Say this would be in a separate class called Date (Actually, I think Date is a class that already exists. I'm just using date as an example). A .h file and a .cpp file.
Would my .h file contain all these declarations, and my .cpp file be empty with an #include "Date.h"?



LinkBack URL
About LinkBacks




Want to add some