The obvious way would be to use std::numeric_limits<unsigned long>::max();
The maximum value of "unsigned long int" in c++
-
24-06-2022 - |
Pergunta
How can I know what is the maximum assignable value for a variable from the the type of "unsigned long int"?
Solução
Outras dicas
Another way to find out would be:
unsigned long int i = (unsigned long int) -1;
printf("%lu\n", i);
In simple way:
unsigned long int i = -1;
std::cout << i;
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow