Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > pointer size depends on what

Reply
Thread Tools

pointer size depends on what

 
 
kumar
Guest
Posts: n/a
 
      05-26-2008
how can i identefy the pointer size
means is taking 4 byte or 2 bytes , on what basis we can decide either
on processor or register
 
Reply With Quote
 
 
 
 
Ian Collins
Guest
Posts: n/a
 
      05-26-2008
kumar wrote:
> how can i identefy the pointer size
> means is taking 4 byte or 2 bytes , on what basis we can decide either
> on processor or register


The question does not make a lot of sense, the sizeof operator will tell
you in code, or consult your compiler and platform documentation.

--
Ian Collins.
 
Reply With Quote
 
 
 
 
kumar
Guest
Posts: n/a
 
      05-26-2008
On May 26, 2:02 pm, "Malcolm McLean" <(E-Mail Removed)> wrote:
> "kumar" <(E-Mail Removed)> wrote in message
> > how can i identefy the pointer size
> > means is taking 4 byte or 2 bytes , on what basis we can decide either
> > on processor or register

>
> It is just possible that different pointer types are different sizes, on
> your system. Normally, however, a pointer is the size of an address
> register, which means 16 bits on a 64K machine, 32 bits on a 4Gb machine,
> and 64 bits on a large machine.
>
> --
> Free games and programming goodies.http://www.personal.leeds.ac.uk/~bgy1mm


thanx, now i got
bye
 
Reply With Quote
 
Barry Schwarz
Guest
Posts: n/a
 
      05-26-2008
On Mon, 26 May 2008 00:31:30 -0700 (PDT), kumar <(E-Mail Removed)>
wrote:

>how can i identefy the pointer size
>means is taking 4 byte or 2 bytes , on what basis we can decide either
>on processor or register


While processor type or register size may influence the compiler
writer to choose a size (or even different sizes), the writer is free
to choose any size as long as the compiler can generate the code to
correctly use that size. For example, many hardware systems use a
4-byte address. The compiler may use a 12-byte pointer and put range
checking information in the extra bytes. Once again, Compiler 1 need
not use the same approach as Compiler 2 and different versions of
Compiler 1 could use different approaches.

If you need to know before compiling, use the documentation for your
implementation. If your code needs to know, then use the sizeof
operator which will produce to the correct value every time.


Remove del for email
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to create an applet java in eclipse from a project whichs depends from a jar file? welsungo Java 0 03-05-2005 12:12 PM
WebException HTTP 400 Bad Request depends on size of file attach vigori ASP .Net Web Services 0 01-05-2005 11:35 AM
Cisco router nat depends on destination IP hdu Cisco 3 01-12-2004 01:03 PM
OT: It Really Depends... Patrick MCSE 1 08-05-2003 02:11 PM
HELP! cookie succes depends on url structure (Struts?) moo moo Java 0 07-21-2003 11:16 AM



Advertisments