class MyClass
{
const int arraySize = 3;//won't work
const int arr[3] = {1, 2, 3}; //won't work
enum{
arraySize = 3;
};
//but I still can't ...
const int arr[arraySize] = {1, 2, 3};
//see, I've got stuff that's really natural in a class definition - rather than implementation
//thus:
enum RANGE {
_OPEN = 0,
_2R,
_20R,
_200R,
_2K,
_20K,
_200K,
_2M
};
const double _RAN[_2M+1] = {
0,
2,
20,
200,
2000,
20000,
200000,
2000000
};
//so that in my code I can say things like setRange(_RAN[_2M]);
}
class MyClass
{
const int arraySize = 3;//won't work
const int arr[3] = {1, 2, 3}; //won't work
enum{
arraySize = 3;
};
//but I still can't ...
const int arr[arraySize] = {1, 2, 3};
//see, I've got stuff that's really natural in a class definition - rather than implementation
//thus:
enum RANGE {
_OPEN = 0,
_2R,
_20R,
_200R,
_2K,
_20K,
_200K,
_2M
};
const double _RAN[_2M+1] = {
0,
2,
20,
200,
2000,
20000,
200000,
2000000
};
//so that in my code I can say things like setRange(_RAN[_2M]);
}
To copy to clipboard, switch view to plain text mode
Bookmarks