hello, I wanted to ask how to get a number from user in C within range and will ask again if value is not in range and if in range continue!
typedef struct {
uint8_t IpV4_1;//unsigned in 0-255 (8 bit int)
uint8_t IpV4_2;
uint8_t IpV4_3;
uint8_t IpV4_4;
uint8_t IpV4_SubNetMask;
}IPFormater;
IPFormater IPformater1;
printf("Enter the target IP address: format X.X.X.X\\X ,\\ = SubNetMask(0-32) Enter 0 in subnet mask to get the defult IP address you entered ");
scanf("%hhu.%hhu.%hhu.%hhu\\%hhu", &IPformater1.IpV4_1, &IPformater1.IpV4_2, &IPformater1.IpV4_3, &IPformater1.IpV4_4, &IPformater1.IpV4_SubNetMask);
I don't want values higher then 255 and lower then 0
