Topic: long long variables?
Author: anglewyrm@hotmail.com ("Jonathan Wooldridge")
Date: Sat, 28 Sep 2002 19:07:01 +0000 (UTC) Raw View
Are long long variables a part of the c++ standard?
The expression "long long someVariable; " produces a 64-bit variable on my
system, twice as long as a normal long. (GCC/Win98)
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: kuyper@wizard.net ("James Russell Kuyper Jr.")
Date: Mon, 30 Sep 2002 17:10:29 +0000 (UTC) Raw View
Jonathan Wooldridge wrote:
> Are long long variables a part of the c++ standard?
Yes, unfortunately. There were many other ways 64-bit types could have
been introduced, and <stdint.h> even includes two of them. However, in
addition to those, the committee also chose to standardize that
ill-conceived notion; I suppose they had to - there's unfortunately a
lot of existing code written for implementation that provided 'long
long' as an extension to C90.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: cpdaniel@pacbell.net ("Carl Daniel")
Date: Mon, 30 Sep 2002 17:11:32 +0000 (UTC) Raw View
""Jonathan Wooldridge"" <anglewyrm@hotmail.com> wrote in message
news:NSml9.482447$_91.706703@rwcrnsc51.ops.asp.att.net...
> Are long long variables a part of the c++ standard?
>
> The expression "long long someVariable; " produces a 64-bit variable on my
> system, twice as long as a normal long. (GCC/Win98)
no.
I believe 'long long' IS part of the C99 standard, but it is not part of C90
or C++98.
-cd
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: eldiener@earthlink.net ("Edward Diener")
Date: Mon, 30 Sep 2002 17:11:48 +0000 (UTC) Raw View
No. There is no mention of a "long long" fundamental type in the C++
standard. However there is nothing preventing a compiler from making another
C++ standard integral type a 64 bit value, as long as the C++ rules for the
relative size relationships of the integral types are obeyed. C++ does not
specify the size in bits of any of its data types.
""Jonathan Wooldridge"" <anglewyrm@hotmail.com> wrote in message
news:NSml9.482447$_91.706703@rwcrnsc51.ops.asp.att.net...
> Are long long variables a part of the c++ standard?
>
> The expression "long long someVariable; " produces a 64-bit variable on my
> system, twice as long as a normal long. (GCC/Win98)
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: jackklein@spamcop.net (Jack Klein)
Date: Mon, 30 Sep 2002 17:24:21 +0000 (UTC) Raw View
On Sat, 28 Sep 2002 19:07:01 +0000 (UTC), anglewyrm@hotmail.com
("Jonathan Wooldridge") wrote in comp.std.c++:
> Are long long variables a part of the c++ standard?
>
> The expression "long long someVariable; " produces a 64-bit variable on my
> system, twice as long as a normal long. (GCC/Win98)
No. They were added to C by the 1999 update to the ISO C standard,
but the 1998 C++ standard is based on an earlier version of C, the
1990 ISO standard plus an amendment and two TCs from the mid 1990's.
They will almost certainly be added to the next version of the C++
standard.
--
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++ ftp://snurse-l.org/pub/acllc-c++/faq
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: gdr@soliton.integrable-solutions.net (Gabriel Dos Reis)
Date: Mon, 30 Sep 2002 17:58:26 +0000 (UTC) Raw View
kuyper@wizard.net ("James Russell Kuyper Jr.") writes:
| Jonathan Wooldridge wrote:
| > Are long long variables a part of the c++ standard?
|
| Yes, unfortunately.
Could you point me to the appropriate chapter and verse?
--
Gabriel Dos Reis gdr@integrable-solutions.net
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: vAbazarov@dAnai.com ("Victor Bazarov")
Date: Mon, 30 Sep 2002 19:22:10 +0000 (UTC) Raw View
"James Russell Kuyper Jr." <kuyper@wizard.net> wrote...
> Jonathan Wooldridge wrote:
> > Are long long variables a part of the c++ standard?
>
> Yes, unfortunately.
Which part of Standard defines that? Thank you.
Victor
--
Please remove capital A's from my address when replying by mail
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: kanze@gabi-soft.de (James Kanze)
Date: Mon, 30 Sep 2002 22:58:34 +0000 (UTC) Raw View
anglewyrm@hotmail.com ("Jonathan Wooldridge") wrote in message
news:<NSml9.482447$_91.706703@rwcrnsc51.ops.asp.att.net>...
> Are long long variables a part of the c++ standard?
No, but they are part of the C standard, and are thus available on many
C++ compilers as well.
> The expression "long long someVariable; " produces a 64-bit variable
> on my system, twice as long as a normal long. (GCC/Win98)
Most 32 bit systems have some way of doing this; VC++ has a _int64 or
__int64 type, or something similar. The best solution is probably a
typedef in some system dependant header file: llong is long long, or
__int64, or if worse comes to worse, a class that you have written.
--
James Kanze mailto:jkanze@caicheuvreux.com
Conseils en informatique orient e objet/
Beratung in objektorientierter Datenverarbeitung
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: kuyper@wizard.net ("James Russell Kuyper Jr.")
Date: Tue, 1 Oct 2002 08:41:31 +0000 (UTC) Raw View
Gabriel Dos Reis wrote:
> kuyper@wizard.net ("James Russell Kuyper Jr.") writes:
>
> | Jonathan Wooldridge wrote:
> | > Are long long variables a part of the c++ standard?
> |
> | Yes, unfortunately.
>
> Could you point me to the appropriate chapter and verse?
>
Sorry - I'm in the habit of monitoring both comp.std.c and comp.std.c++,
and I sometimes lose track of which standard I'm talking about. :-}
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]