Re: UnSigned Long
- From: "Mike Wahler" <mkwahler@xxxxxxxxxxxx>
- Date: Mon, 29 Aug 2005 18:48:00 GMT
"Joriveek" <nojunk@xxxxxxxxxx> wrote in message
news:deunjb$ef8$1@xxxxxxxxxxxxxxxxxxxxxxxxx
> Hi,
>
> I want to store myvarz = 3000000000;
>
> I have declared myvarz as unsigned long; still not taking.
unsigned long myvarz = 3000000000
>
>
> I am using MSVC++ 6.0
>
> Any help please urgent....
The C language standard requires that type 'unsigned long'
can represent a minimum range of values from zero (0) through
4294967295, inclusive. Your value 3000000000 falls within
this range.
I compiled the following code with Microsoft
Visual C++ v6.0 :
#include <stdio.h>
int main()
{
unsigned long myvarz = 0;
myvarz = 3000000000;
printf("%lu\n", myvarz);
return 0;
}
I got output of:
3000000000
So perhaps you could specify what you mean by 'not taking'.
How did you verify there's a problem? With a debugger?
Did you print out the value? If so, which 'printf()' format
specifier did you use?
-Mike
.
- References:
- UnSigned Long
- From: Joriveek
- UnSigned Long
- Prev by Date: Re: Style isn't always religious
- Next by Date: Re: while (1) vs. for ( ;; )
- Previous by thread: Re: UnSigned Long
- Next by thread: Re: UnSigned Long
- Index(es):