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
Post a Comment