c++ - What does "prompting" for an integer mean? -


i have following question on test review:

you write program following:

  • prompt user 32-bit integer number entered text via console
  • determine if number prime
  • output either phrase “prime” or “not prime” appropriate

i'm confused prompting 32-bit integer. same declaring normal int variable?

short answer: no. longer answer: possibly yes.

why? int doesn't have fixed size; it's defined having at least 16 bits. might happen have 32 bits, isn't guaranteed. use int32_t or uint32_t purpose.


Comments

Popular posts from this blog

c++11 - Intel compiler and "cannot have an in-class initializer" when using constexpr -

rest - Spring boot: Request method 'PUT' not supported -

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -