473,671 Members | 2,384 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Get the Limit of a Data type

46 New Member
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
3 4286
Banfa
9,065 Recognized Expert Moderator Expert
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
125 New Member
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
Velhari
46 New Member
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

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

Similar topics

0
3088
by: Ed | last post by:
------=_NextPart_000_001D_01C34FCC.1D2B5E50 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable There seems to be a significant penalty imposed by the optimizer when = these 3 clauses are uses together. If we use the Full Text Search the penalty = is gone. However, the Full Text Search is not a very good option in my =
1
3041
by: Steve | last post by:
I've run in to a problem with a query I'm trying to write. I have attached a sample SQL script at the end of this post to show an overview of what I'm working with. I want to be able to use LIMIT to control how many rows from one table are returned, independent of how many rows there are in a second table that is joined to the first. When I execute the following SQL script:
5
12133
by: Jesper Rønn-Jensen | last post by:
I have a textarea that must be limited to 70 characters. No big deal -- at least so I thought. * Textarea must not exceed 70 characters * Exceeding content must be cut off * Must work on input by keyboard (keypress, keyup events) * Must work on pasted input from context menu * Must work on pasted input via CTRL+V and similar * Must work on pasted input via browsers menu>Edit>Paste * Must work in Mozilla + IE and coded via W3C standards
0
5777
by: D. Dante Lorenso | last post by:
I need to know that original number of rows that WOULD have been returned by a SELECT statement if the LIMIT / OFFSET where not present in the statement. Is there a way to get this data from PG ? SELECT ... ; ----> returns 100,000 rows
3
10159
by: JOSHUA JACKS | last post by:
I receive data from a web form in csv (comma and quote) form which I import into Access. The data include some long narratives (three fields of two to three paragraphs). Access seems to cut off the data at some length limit, however if I import the same data into an Excell spreadsheet, nothing gets cut off. Any ideas how to get all the data into Access without going through some intermediate step with Excell?
2
1321
by: akki | last post by:
Hi all, i am creating an ASP.net web appln which was working fine till now but suddenly I developed a new problem. when i am trying to insert data in a new row in one of my tables,it gave an error. the table has 1 column called question description which stores the questions.When i reduced the size of the question it worked fine. the column is of type ntext Now, isnt ntext supposed to store large data without worrying about the row size...
1
6668
by: Jan | last post by:
Is there a 2GB size limit on Access2003/XP ? If so, is there an easy way to span across more than one MDB file?
5
4747
by: - | last post by:
I have only 1m records in my database running on a laptop of speed 1.6GHz, memory 512MB ram, and Toshiba MK8032GAX hard disk. I use 'LIMIT x,10' for the query to utilise record paging. When the value of x is nearer to 0, the query speed is fast. Presently, 'LIMIT 0,10', 'LIMIT 50000,10' and 'LIMIT 100000,10' takes about 0sec, 11secs and 4mins respectively. 1) Is there anything I should do, in terms of sql statement or database design,...
6
4861
by: howa | last post by:
Suppose the file is stored in "upload_tmp_dir ", so why I need to increase the memory limit? If I want to upload 100 MB, how large should I set? Thanks.
0
8400
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8672
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7441
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6234
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4412
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2817
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1814
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.