I can not initialize LENGTH_STRING , the compiler swears at the last line " error C2131: выражение не определяется константой ", and if you do LENGTH_STRING=100 , then everything works. Is there a way to initialize LENGTH_STRING through previous constants?
#include <climits> inline int getT(unsigned int x) { int p = 0; while (x > 10) { p++; x /= 10; } return p; } const unsigned int N = USHRT_MAX - 1; const int T = getT(N); const int LENGTH = 1000; const int LENGTH_STRING = (T+1)*LENGTH;