By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,440 Members | 1,411 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,440 IT Pros & Developers. It's quick & easy.

How to Get the Limit of a Data type

P: 46
Hi all,

Is there any way to get the Limit of Data type in C. Let us take for character data type have 255 is the Limit. so for each and every data type certain limits are there..... so how to get those types at run time.... is it possible means how?????

With Regards,
VELMURUGAN.H
Dec 21 '06 #1
Share this Question
Share on Google+
3 Replies


Banfa
Expert Mod 5K+
P: 8,916
The limits for integer types (char, short, int long plus unsigned varieties) are all #defined in limits.h

float.h contains similar information for float, double and long double.


Oh and 255 is only the limit for char on systems where char is unsigned. On systems where char is signed (which is quite a lot of them) the limit is 127.
Dec 21 '06 #2

sanjay123456
100+
P: 125
dear ,

There r anoher type of solution that we take a array of any data type and and store the any number them .after this we have difference betwween second and first address of array and print it it will be range of data type in byte

Hope this is help to undrstand u

sanjay
Dec 22 '06 #3

P: 46
The limits for integer types (char, short, int long plus unsigned varieties) are all #defined in limits.h

float.h contains similar information for float, double and long double.


Oh and 255 is only the limit for char on systems where char is unsigned. On systems where char is signed (which is quite a lot of them) the limit is 127.
Thank you Mr.Banfa for your valuabel information
Dec 22 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.