Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

621
Visualizações
Is there a standard macro in C or C++ represent the max and min value of int32_t, int64_t?

Is there any macro in C or C++ represent the max and min value of int32_t and int64_t? I know it can be literally defined by oneself, but it's better if there is a standard macro. Please note I'm not asking about max of int, long ,etc. but intXX_t

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

In C++, there is std::numeric_limits::min() and std::numeric_limits::max() in the <limits> header:

std::cout << std::numeric_limits<std::int32_t>::min() << std::endl;

and so on. In C, the header <stdint.h> defines INT32_MIN, INT32_MAX etc. These are also available in the C++ <cstdint> header.

over 4 years ago · Santiago Trujillo Relatório

0

In C++ you can use header <limits> and class std::numeric_limts declared in this header.

To know the max and min values of types int32_t and int64_t you can write for example

#include <cstdint>
#include <limits>

//...

std::cout << std::numeric_limits<int32_t>::max() << std::endl;
std::cout << std::numeric_limits<int32_t>::min() << std::endl;
std::cout << std::numeric_limits<int64_t>::max() << std::endl;
std::cout << std::numeric_limits<int64_t>::min() << std::endl;

In C you should include header <stdint.h> and use corresponding macros defined in the header as for example

INT32_MIN
INT32_MAX
INT64_MIN
INT64_MAX
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda