What is meant by range in data type of c;like char has a range from 0 to 255? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is meant by range in data type of c;like char has a range from 0 to 255?

18th Nov 2016, 4:18 AM
Sangharsh Seth
Sangharsh Seth - avatar
2 Answers
+ 1
Range means the maximum and minimum value that can be stored inside the variable of a given type. For example if you have unsigned char and if we assume that the size of the datatype is 8 bits then you can store values ranging from 0 - 2^8-1 i.e. 0-255 inside it.
18th Nov 2016, 5:42 AM
AMIR GHODI
AMIR GHODI - avatar
+ 1
we declare character like maybe a,b or any alphabet so is the value 0 to 255 has anything to do with ASCI values of alphabet.Can you please elaborate if yes or no.
18th Nov 2016, 5:51 AM
Sangharsh Seth
Sangharsh Seth - avatar