473,372 Members | 1,015 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 software developers and data experts.

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 2360
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: PengYu.UT | last post by:
Hi, I read Klaus Kreft & Angelika Langer's C++ Expression Templates: An Introduction to the Principles of Expression Templates at...
15
by: Nerox | last post by:
Hi, If i write: #include <stdio.h> int foo(int); int main(void){ int a = 3; foo(a); }
8
by: Rajeev Soni | last post by:
Hi I am looking for the regular expression for validating the allowed file types to upload like files like "zip,pdf,doc,rtf,gif,jpg,png,txt"; and the expression should not be case sensitive like...
6
by: Ludwig | last post by:
Hi, i'm using the regular expression \b\w to find the beginning of a word, in my C# application. If the word is 'public', for example, it works. However, if the word is '<public', it does not...
18
by: njgreen2001 | last post by:
I thought the length of this might give me problems. Any suggestions on how to shorten it? Expression: =IIf(="A Pos" And ="A Pos",(DLookUp("","")), IIf(="A Pos" And ="A...
13
by: hn.ft.pris | last post by:
Hi: I have the following simple program: #include<iostream> using namespace std; int main(int argc, char* argv){ const double L = 1.234; const int T = static_cast<const int>(L); int arr;
3
by: bob_jenkins | last post by:
In C# 2.0, given an arbitrary expression and the types of the variables referenced in it, how do I find the expression type? For example, int x; float y; what is the type of x+y? If I had...
18
by: dspfun | last post by:
Hi! The words "expression" and "statement" are often used in C99 and C- textbooks, however, I am not sure of the clear defintion of these words with respect to C. Can somebody provide a sharp...
8
by: Stefano Sabatini | last post by:
Hi all, I'm encountering this while trying to implement a factory singleton method to generate objects. The singleton has a static map which binds a static creation function defined in each...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.