Re: 64 bit pointer in C
- From: andrew@xxxxxxxxxxxxxxxxxxxx (Andrew Gabriel)
- Date: Fri, 30 Oct 2009 21:06:07 +0000 (UTC)
In article <87zl7hhlf0.fsf@xxxxxxxxx>,
tony_curtis32@xxxxxxxxx writes:
jay <gl@xxxxxxxxxxxxxxxx> writes:
this oughta be simple, but somehow i can't blunder my
way on to it. it's probably a FAQ. either solaris compilers
or gcc ought to be enough of a hint for me -- if i have one
i expect i can find the other.
sizeof( int * ) for int, double, this, that, the other always
gives me 4 bytes. that means on a 64 bit machine w/
16GB memory i'll "run out" of addresses. are there compiler
options that will give me 64 bit pointer sizes?
$ cat pointer.c
#include <stdio.h>
#define DO_PTR_SIZE(type) printf("sizeof(%s *) = %d\n", #type, sizeof(type *))
int
main(void)
{
DO_PTR_SIZE(char);
DO_PTR_SIZE(short);
DO_PTR_SIZE(int);
DO_PTR_SIZE(long);
DO_PTR_SIZE(double);
return 0;
}
There's a more fully featured program enquire.c which does this
and lots more, http://homepages.cwi.nl/~steven/enquire.html
--
Andrew Gabriel
[email address is not usable -- followup in the newsgroup]
.
- Follow-Ups:
- Re: 64 bit pointer in C
- From: Paul Floyd
- Re: 64 bit pointer in C
- References:
- 64 bit pointer in C
- From: jay
- Re: 64 bit pointer in C
- From: tony_curtis32
- 64 bit pointer in C
- Prev by Date: Re: Change root password in a zone.
- Next by Date: Re: Change root password in a zone.
- Previous by thread: Re: 64 bit pointer in C
- Next by thread: Re: 64 bit pointer in C
- Index(es):
Relevant Pages
|