answersLogoWhite

0


Best Answer

Basic built-in data types in the C Programming language are scalar types in variations of char, int and float:

char, unsigned char, signed char

int, signed int, unsigned int, short, signed and unsigned short, long, signed and unsigned long

float, double

Named enumerations are supported. These are weakly typed constant literals of type int. Bitfields are supported as range-limited signed or unsigned integers. Neither qualify as a type in their own right.

Some dialects also support additional types, such as wide character, extra large integers or floating point scalars.

The language also knows a related keyword void, which is used to express the fact that the related item has no known or no specific type. void in itself is not a type (it is rather the absence of a type).

The C programming language also supports three basic aggregates: structure, union and arrays.

Pointers can reference any of the scalar built-ins, enumerations, structures, unions, arrays, and the infamous void. Pointers are viewed as a data type by many.

Other members of the C family of languages also support class and interface types and strongly typed enumerations.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

9y ago

The range of all fundamental types is compiler-dependant. The standard specifies that a char is always 1 byte in length and that a byte is at least 8 bits in length. This is because C source code is written using ASCII character codes which require at least 8-bits per byte. It is never safe to assume that all supported architectures use an 8-bit byte.

A char may be signed or unsigned depending on the compiler implementation. Some compilers will allow you to specify whether a char is signed or unsigned. As a result, a char is treated independent of the explicitly signed or unsigned char types. Thus there are three char types in total: char (often referred to as plain char), signed char and unsigned char. The standard states that all three will have the same length. As such, an unsigned char will have a range of at least 0 to 255 while a signed char will have a range of at least -127 to 127. The range of a plain char depends on whether it is signed or unsigned.

Note that the lower range of a signed char is -127, not -128 as might be expected. This is because ones-complement notation has two representations for the value zero, one positive, the other negative. -128 is only possible with twos-complement notation, but not all systems use twos-complement.

All other types are expressed in terms of a char, such that a short is always at least as long as a char, an int is always at least as long as a short, a long int is always at least as long as an int and a long long int is always at least as long as a long int. Use the sizeof() operator to determine the exact length (in bytes). The compiler will also provide constants in the C-standard library that define the length of a byte (in bits) as well as the upper and lower range of each type. Never make assumptions about the size or range. If you do, your code will not be portable.

This answer is:
User Avatar

User Avatar

Wiki User

15y ago

Platform-dependent, but if consult your header limits.h,you will find out.

(eg: int's range is INT_MIN..INT_MAX)

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are the ranges of basic datatype of C' programming languages?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What are BASIC and FORTRAN?

BASIC and FORTRAN are computer programming languages.


Why are brilliant math students so terrible at programming languages?

Because they don't get proper guidence of a knowlegable programming teacher who will built them from basic/abc to top of programming languages.


.net is the programming language?

No. .NET is a framework, not a programming language. It is the common framework used by the C#, F# and Visual Basic programming languages.


Distinguish between C programming and BASIC programming?

C is a systems language for precise, concrete development. BASIC and its derivatives are teaching and prototyping languages for rapid, abstract development.


List 3 programming languages available in the NET Framework?

c#,Visual basic and Cobol


What were the major programming languages throughout history?

fortran language,basic language,cobol language.


Put these programming languages in order from oldesr to newest basic c plus plus cobol?

cobolbasicc++


What are the three basic programming languages?

Machine Code, Assembler, & High Level (FORTRAN, COBOL, C).


Can you make a dress up game using Visual basic?

Yes you can, however there are better programming languages for this.


Which Programming languages came first between BASIC C COBOL AND Foltran?

Fortran (Foltran is a misspelling)


Where can you find a guide to one of the more basic computer programming languages for free?

Visual basic is a pretty basic language and you can get it for free from Microsoft. Download it at http://www.microsoft.com/express/vb/default.aspxMost public libraries will have books about various popular programming languages. You can also find manuals, guides, specifications, tutorials, and support for many, many computer languages by searching the internet.


What type of language is BASIC?

Basic was one of the very first programming languages used in DOS. It is not object oriented and is obsolete. If you want to learn to programe start with Visual Basic no BASIC.