PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.c > pointer size depends on what
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
pointer size depends on what

Réponse
 
LinkBack Outils de la discussion
Vieux 26/05/2008, 08h31   #1
kumar
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut pointer size depends on what

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
  Réponse avec citation
Vieux 26/05/2008, 08h45   #2
Ian Collins
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: pointer size depends on what

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.
  Réponse avec citation
Vieux 26/05/2008, 10h02   #3
Malcolm McLean
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: pointer size depends on what


"kumar" <raman.emb@gmail.com> 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


  Réponse avec citation
Vieux 26/05/2008, 15h11   #4
kumar
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: pointer size depends on what

On May 26, 2:02 pm, "Malcolm McLean" <regniz...@btinternet.com> wrote:
> "kumar" <raman....@gmail.com> 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
  Réponse avec citation
Vieux 26/05/2008, 18h26   #5
Barry Schwarz
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: pointer size depends on what

On Mon, 26 May 2008 00:31:30 -0700 (PDT), kumar <raman.emb@gmail.com>
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
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 12h52.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,12766 seconds with 13 queries