I am trying to check the input for 8 bit an unsigned integer is this the right why to go about it?
struct int8bit
{
unsigned int number : 8;
}
.
mussa187 0 Light Poster
Recommended Answers
Jump to PostNo.
Use an if statement.
Jump to Postyeah, I think the only way to check is the value. Since an unsigned 8 bits integer (or unsigned char) can only store (0 to 255). The best way is to check whether the value is between the range.
*make sure the memory for storing input is sufficient. After …
All 5 Replies
Salem 5,265 Posting Sage
mussa187 0 Light Poster
VernonDozier 2,218 Posting Expert Featured Poster
Salem 5,265 Posting Sage
chiwawa10 77 Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.