Is the unsigned long long primitive data type supported in ANSI
standard C?
I've tried using it a couple of times in standard C, but to no avail.
I'm using both MS VIsual C++ 6, as well as the gcc compiler that comes
with RedHat linux 9.
If not, what data type will yield the largest unsigned integer for me?
Thanks for your help,
Rich 29 19613
Richard A. Huebner <en*****@yahoo. com> scribbled the following: Is the unsigned long long primitive data type supported in ANSI standard C?
In C99, yes. In C90, no. Most current implementations of ANSI standard
C are still C90.
I've tried using it a couple of times in standard C, but to no avail. I'm using both MS VIsual C++ 6, as well as the gcc compiler that comes with RedHat linux 9.
If not, what data type will yield the largest unsigned integer for me?
unsigned long.
--
/-- Joona Palaste (pa*****@cc.hel sinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"I wish someone we knew would die so we could leave them flowers."
- A 6-year-old girl, upon seeing flowers in a cemetery
"Joona I Palaste" <pa*****@cc.hel sinki.fi> wrote in message
news:bo******** **@oravannahka. helsinki.fi... I've tried using it a couple of times in standard C, but to no avail. I'm using both MS VIsual C++ 6, as well as the gcc compiler that comes with RedHat linux 9.
If not, what data type will yield the largest unsigned integer for me?
unsigned long.
Actually GCC has supported "unsigned long long" for quite some time. MSVC
supports "unsigned __int64" which is a 64-bit type..
Tom
Richard A. Huebner wrote: If not, what data type will yield the largest unsigned integer for me?
I don't know how to answer your question.
uint64_t might be useful still?
Tom St Denis <to********@iah u.ca> scribbled the following: "Joona I Palaste" <pa*****@cc.hel sinki.fi> wrote in message news:bo******** **@oravannahka. helsinki.fi... > I've tried using it a couple of times in standard C, but to no avail. > I'm using both MS VIsual C++ 6, as well as the gcc compiler that comes > with RedHat linux 9. > If not, what data type will yield the largest unsigned integer for me?
unsigned long.
Actually GCC has supported "unsigned long long" for quite some time. MSVC supports "unsigned __int64" which is a 64-bit type..
Yes, but hardly in ANSI standard C, or what?
--
/-- Joona Palaste (pa*****@cc.hel sinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"Immanuel Kant but Genghis Khan."
- The Official Graffitist's Handbook
"Joona I Palaste" <pa*****@cc.hel sinki.fi> wrote in message
news:bo******** **@oravannahka. helsinki.fi... Tom St Denis <to********@iah u.ca> scribbled the following: "Joona I Palaste" <pa*****@cc.hel sinki.fi> wrote in message news:bo******** **@oravannahka. helsinki.fi... > I've tried using it a couple of times in standard C, but to no avail. > I'm using both MS VIsual C++ 6, as well as the gcc compiler that
comes > with RedHat linux 9.
> If not, what data type will yield the largest unsigned integer for
me? unsigned long. Actually GCC has supported "unsigned long long" for quite some time.
MSVC supports "unsigned __int64" which is a 64-bit type..
Yes, but hardly in ANSI standard C, or what?
ANSI is old. I for one welcome our new ISO overlords.
Tom
Tom St Denis <to********@iah u.ca> scribbled the following: "Joona I Palaste" <pa*****@cc.hel sinki.fi> wrote in message news:bo******** **@oravannahka. helsinki.fi... Tom St Denis <to********@iah u.ca> scribbled the following: > "Joona I Palaste" <pa*****@cc.hel sinki.fi> wrote in message > news:bo******** **@oravannahka. helsinki.fi... >> > I've tried using it a couple of times in standard C, but to no avail. >> > I'm using both MS VIsual C++ 6, as well as the gcc compiler that comes >> > with RedHat linux 9. >> >> > If not, what data type will yield the largest unsigned integer for me? >> >> unsigned long. > Actually GCC has supported "unsigned long long" for quite some time. MSVC > supports "unsigned __int64" which is a 64-bit type..
Yes, but hardly in ANSI standard C, or what?
ANSI is old. I for one welcome our new ISO overlords.
I would think that the difference between the ANSI and ISO versions of
the C standard is entirely bureaucratic and has no effect on the
technical content.
--
/-- Joona Palaste (pa*****@cc.hel sinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"'So called' means: 'There is a long explanation for this, but I have no
time to explain it here.'"
- JIPsoft
"Joona I Palaste" <pa*****@cc.hel sinki.fi> wrote in message
news:bo******** **@oravannahka. helsinki.fi... ANSI is old. I for one welcome our new ISO overlords.
I would think that the difference between the ANSI and ISO versions of the C standard is entirely bureaucratic and has no effect on the technical content.
Be that as it may "unsigned long long" is part of ISOC AFAIK.
Tom
Tom St Denis <to********@iah u.ca> scribbled the following: "Joona I Palaste" <pa*****@cc.hel sinki.fi> wrote in message news:bo******** **@oravannahka. helsinki.fi... > ANSI is old. I for one welcome our new ISO overlords. I would think that the difference between the ANSI and ISO versions of the C standard is entirely bureaucratic and has no effect on the technical content.
Be that as it may "unsigned long long" is part of ISOC AFAIK.
ISO C99, Tom. Not ISO C90.
--
/-- Joona Palaste (pa*****@cc.hel sinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"I am looking for myself. Have you seen me somewhere?"
- Anon
"Joona I Palaste" <pa*****@cc.hel sinki.fi> wrote in message
news:bo******** **@oravannahka. helsinki.fi... Tom St Denis <to********@iah u.ca> scribbled the following: "Joona I Palaste" <pa*****@cc.hel sinki.fi> wrote in message news:bo******** **@oravannahka. helsinki.fi... > ANSI is old. I for one welcome our new ISO overlords.
I would think that the difference between the ANSI and ISO versions of the C standard is entirely bureaucratic and has no effect on the technical content.
Be that as it may "unsigned long long" is part of ISOC AFAIK.
ISO C99, Tom. Not ISO C90.
Tom assumes we're dealing with the latest not the oldest.
Otherwise crack out some K&R !
Tom This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: George Marsaglia |
last post by:
The essence of a multiply-with-carry RNG is to have
declarations in the RNG proc, such as
unsigned long mwc( ){
static unsigned long x = 123456789, c = 362436;
unsigned long long t, a = 916905990LL;
\*
then reatedly form the 64-bit t = a*x+c, after which
the new carry c is the top 32,
and the new x (output), is the bottom 32 bits of t:
|
by: Sushil |
last post by:
hi Gurus
I'm a newbie learning C.
I've a question, relevant code snippet is as follows :
typedef unsigned long long ulonglong;
struct foo {
unsigned dummy : 2;
unsigned n : 24;
|
by: Peter Ammon |
last post by:
When I add an unsigned long long and an int, what type do each of the
values get promoted to before the addition is performed? What is the
type of the resulting expression? What occurs if the addition overflows
or underflows?
Thanks,
-Peter
|
by: Digital Puer |
last post by:
Hi, suppose I have an unsigned long long. I would like to extract
the front 'n' bits of this value and convert them into an integer.
For example, if I extract the first 3 bits, I would get an int between
0 and 7 (=2^3-1). Could someone please help out?
I can assume the largest returned value fits in an int. Also,
I'm on a big-endian PPC (AIX), in case that matters.
Ideally, I'd like to implement a prototype like:
int...
|
by: luke |
last post by:
Hi everybody,
please, can someone explain me this behaviour.
I have the following piece of code:
long long ll;
unsigned int i = 2;
ll = -1 * i;
printf("%lld\n", ll);
| |
by: Nicholas Zhou |
last post by:
Hi,
I was writing a testing program to test the ranges of char, short, int
and long variables on my computer, both signed and unsigned.
Everything was fine except for unsigned int and unsigned long. I got
0 to -1 for both. The expected answers should be:
unsigned int: 0 to 65535
unsigned long: 0 to 4294967295
|
by: vadivel.ks |
last post by:
hi,
My code having unsigned long long int64_t;
like that.. compile error message is long followed by long is
illegal,
what is the reason for it?
|
by: Bart C |
last post by:
I've always had a problem knowing exactly how wide my integer variables were
in C, and the little program below has increased my confusion.
Run on 3 compilers on the same cpu (32-bit pentium), sometimes int and long
int are the same, and long long int is twice the width; or sometimes both
long int and long long int are twice the width of int.
This apparently all quite normal according to my c99 draft and c-faq.com.
However it doesn't...
|
by: Tarique |
last post by:
This program was compiled on MS Visual C++ 08
/*Fibonacci Numbers*/
#include<stdio.h>
#include<limits.h>
void fibonacci(int n)
{
unsigned long long fib0 = 0; /*First Fibonacci Number*/
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |