Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > expression types

Reply
Thread Tools

expression types

 
 
sophia.agnes@gmail.com
Guest
Posts: n/a
 
      12-03-2007
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?
 
Reply With Quote
 
 
 
 
santosh
Guest
Posts: n/a
 
      12-03-2007
http://www.velocityreviews.com/forums/(E-Mail Removed) 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.

 
Reply With Quote
 
 
 
 
jameskuyper@verizon.net
Guest
Posts: n/a
 
      12-03-2007


(E-Mail Removed) 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.
 
Reply With Quote
 
pete
Guest
Posts: n/a
 
      12-04-2007
(E-Mail Removed) 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
C/C++ language proposal: Change the 'case expression' from "integral constant-expression" to "integral expression" Adem C++ 42 11-04-2008 12:39 PM
C/C++ language proposal: Change the 'case expression' from "integral constant-expression" to "integral expression" Adem C Programming 45 11-04-2008 12:39 PM
Can XSD simple types be derived from complex types? Soren Kuula XML 2 12-01-2005 07:51 PM
Where are ref types that are members of value types stored? Sathyaish ASP .Net 2 05-22-2005 07:32 PM
STD types vs C++ intrinsic types Jeremy Cowles C++ 5 08-19-2003 05:33 PM



Advertisments