expression types

Discussion in 'C Programming' started by sophia.agnes@gmail.com, Dec 3, 2007.

  1. Guest

    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, 2007
    #1
    1. Advertising

  2. santosh Guest

    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.
    santosh, Dec 3, 2007
    #2
    1. Advertising

  3. Guest

    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, 2007
    #3
  4. pete Guest

    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
    pete, Dec 4, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sathyaish
    Replies:
    2
    Views:
    583
    Sathyaish
    May 22, 2005
  2. Soren Kuula
    Replies:
    2
    Views:
    546
    Henry S. Thompson
    Dec 1, 2005
  3. Jeremy Cowles

    STD types vs C++ intrinsic types

    Jeremy Cowles, Aug 18, 2003, in forum: C++
    Replies:
    5
    Views:
    1,868
    Bob Jacobs
    Aug 19, 2003
  4. Steve Knight
    Replies:
    2
    Views:
    746
    Steve Knight
    Oct 10, 2003
  5. Manlio Perillo

    missing types in module types?

    Manlio Perillo, May 29, 2004, in forum: Python
    Replies:
    0
    Views:
    344
    Manlio Perillo
    May 29, 2004
Loading...

Share This Page