470,572 Members | 2,574 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,572 developers. It's quick & easy.

expression types

Dear all,

what are the major expression types in c?

i have seen the following types of expressions

1) constant expressions
2) integral expressions
3) float expressions
4) pointer expressions

is there any other expression type in c?
Dec 3 '07 #1
3 2185
so**********@gmail.com wrote:
Dear all,

what are the major expression types in c?

i have seen the following types of expressions

1) constant expressions
2) integral expressions
3) float expressions
4) pointer expressions

is there any other expression type in c?
See section 6.5 of the Standard.

Dec 3 '07 #2


sophia.ag...@gmail.com wrote:
Dear all,

what are the major expression types in c?

i have seen the following types of expressions

1) constant expressions
2) integral expressions
3) float expressions
4) pointer expressions

is there any other expression type in c?
You can classify expressions in many different ways. However, if you
want to have a mutually exclusive hierarchial list of categories, your
item 1 doesn't belong with your items 2-4, since a constant expression
can have any of those other types.

The most natural way to categorize expressions is based upon which
operator acts at the highest level in the expression.

Your items 2-4 classify expressions by the type of the value of the
expression. There's a complicated hierarchy of type categories.
There's several named type categories under "integer types", and
"floating types". There's a larger type category that includes both:
"arithmetic types". A still larger type category includes "pointer
types", which is called "scalar types". A distinct type category which
you haven't mentioned is "aggregate types", which is comprised of
array and structure types. These are all object types. There are also
function types and incomplete types.
There's also a few data type categories that cross boundaries between
other type categories, preventing the type category system being
presented as a pure hierarchy. Examples: character types, real types,
derived types (pointer, structure, union, and array types). For every
one of these type categories, it's possible to construct an expression
whose value has that type.
Dec 3 '07 #3
so**********@gmail.com wrote:
>
Dear all,

what are the major expression types in c?

i have seen the following types of expressions

1) constant expressions
2) integral expressions
3) float expressions
4) pointer expressions

is there any other expression type in c?
There's
1 Function types
according to return type and parameter types.
Function types don't have sizes.
2 Incomplete types
void, which can't be completed and
other types which can be completed.
Incomplete types don't have sizes.
Expressions of incomplete types don't have values.
3 Object types
Expressions of object types have sizes.
A Scalar types
1 Arithmetic types
a Basic types
1 char
2 Integer types
A signed integer types
1 signed char
2 short int
3 int
4 long int
5 long long int
B unsigned integer types.
1 unsigned char
2 unsigned short
3 unsigned
4 long unsigned
5 long long unsigned
3 Floating types
A float
B double
C long double

b Complex types
2 Pointer Types
a Function pointers
b Object pointers
B Aggregate types
1 Arrays
2 Structures
C Unions
--
pete
Dec 4 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by PengYu.UT | last post: by
8 posts views Thread by Rajeev Soni | last post: by
6 posts views Thread by Ludwig | last post: by
3 posts views Thread by bob_jenkins | last post: by
18 posts views Thread by dspfun | last post: by
8 posts views Thread by Stefano Sabatini | last post: by
1 post views Thread by livre | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.