473,382 Members | 1,512 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,382 software developers and data experts.

Immediate data

Hi group

Which types are immediates by default?
It would be logical if they were of the largest compatible type..

Any way, take these three examples, followed by my guess:

1, int
FFFFFFFF, unsigned int
'a', int
1.2, double
1e300, double

Thank you!
Nov 14 '05 #1
2 1537
in comp.lang.c i read:
Which types are immediates by default?
what are these `immediates' of which you speak? i see constants below.
It would be logical if they were of the largest compatible type..
they are the narrowest sensible type. (char, short and float are not in
this set.)
1, int
correct.
FFFFFFFF, unsigned int
this isn't a valid hexadecimal constant, you forgot the 0x prefix. given
that as an assumed correction...

it depends on the width of the implementation's int's -- it can be int,
unsigned int, long or unsigned long. i.e., you may think that 32 bit int's
are universal -- they are not; plenty of platforms exist where int is 16 or
64 bits (or other, seemingly stranger values). the most common types today
are unsigned int or unsigned long.
'a', int
1.2, double
1e300, double


correct.

--
a signature
Nov 14 '05 #2
On Tue, 18 May 2004 02:25:56 -0700, Martin Johansen <mf**@online.no>
wrote in comp.lang.c:
Hi group

Which types are immediates by default?
It would be logical if they were of the largest compatible type..

Any way, take these three examples, followed by my guess:

1, int
FFFFFFFF, unsigned int
'a', int
1.2, double
1e300, double

Thank you!


From the examples in your post, I assume what you are calling
"immediates" is what the C standard just calls "constants".

The answer depends on both the way the constant is written and whether
or not any suffixes are used.

Decimal integer constants have the first type in which the value is
representable out of int, long int, long long int. Octal or
hexadecimal constants go through int, unsigned int, long, unsigned
long, long long, unsigned long long.

FFFFFFFF is an identifier or macro, not a constant, although
0xFFFFFFFF is a constant. It might be signed int, unsigned int,
signed long, or unsigned long, depending on the implementation's
representation of these types.

All single character constants have type int.

All floating point constants have type double unless they are suffixed
with one of 'f', 'F', which makes them floats, or 'l' or 'L' which
makes them long doubles.

Buying a decent C reference book might be in order.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Nov 14 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Tony | last post by:
Hello, Using Access2000, WinNT. Using the Immediate Window, I can view the results of my VBA code as it performs operations/calculations on my data. Now that I have all the bugs worked out,...
2
by: Jon Davis | last post by:
How do I get the Immediate window back? It seems to be gone. Command window doesn't work. "View" menu items don't seem to show it Jon
7
by: rodchar | last post by:
Hey all, when i'm in debug mode, is there a way to get to a certain record in a dataset (say like in the Immediate window or something)? thanks, rodchar
3
by: Russell Stevens | last post by:
Can anyone tell me how to get to the immediate window in VS2005. The help file says (when debugging) to click Debug, Windows, Immediate. There is no Immediate window listed there, nor anywhere else...
11
by: sara | last post by:
I am trying my first functions in my code. I have a set of queries that runs to create temp tables with the right data for some reports. They can run for a long time, so I want the user to know...
3
by: nghivo | last post by:
My environment DB2 9.1.4 on Sun OS I write a C embedded SQL to load data. I declare host vars as: EXEC SQL BEGIN DECLARE SECTION; SQL TYPE IS CLOB(599999) sqlStr; EXEC SQL END DECLARE...
3
by: Rahul Babbar | last post by:
Hi, I have the following doubt. Suppose I use the execute immediate statement and the statement to be executed is a Select statement from the sysibm.sysdummy1 table which will always return...
5
by: stmfc | last post by:
i dont know why pl/sql block below returns no data found error. do you have any idea about it? declare c1 varchar2(80); c2 varchar2(80); begin execute immediate 'select col2 from table1 where...
6
by: Oliver | last post by:
I'm fairly new to DB2. I have been assigned to build a delete trigger that finds the data type of each of the table's fields so that the trigger can then build a string consisting of OLD values...
4
by: raylopez99 | last post by:
I'm reading a book that talks about how some operations, like LINQ queries, are "deferred execution" while other queries are "immediate execution". What is the difference? RL
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.