sizeof(char)

Balafoutis Elias balaf at dialup.isc.tuc.gr
Mon Nov 30 12:05:44 EET 1998



Christos Cheretakis wrote:

> Michalis Kabrianis wrote:
> >
> > On 28-Nov-98 Nikos Mavroyanopoulos wrote:
> > > Ligo asxeth h erwthsh, alla shmantiki gia mena. Yparxoun systimata opou
> > > to sizeof(char) na einai megalytero tou 1 ?
> > > Einai kati dedomeno h mporei na allazei opws tou int?
> > > euxaristw...
> > >
> > > --
> > >
> > >         Nikos G.Mavroyanopoulos
> > >           nmav at i-net.paiko.gr
> > > finger/pgpkey: ma06205 at hermes.cc.uoi.gr
> >
> > Den kserw, alla thetw ton problimatismo mou.
> > To char einai apla ena unsigned int apo 0 ews 256 gia to opoio mia thesi
> > ftanei, ARA prepei na einai panta 1.
> > To size tou int allazei, epeidi allazoun ta oria tou int, etsi den einai?
> > Stin Java twra, nomizw oti xrisimopoieitai unicode systima, opote prepei na
> > einai megalytero (kai nomizw oti einai 4).
> >
> > Pantws me endiaferei kai emena na mathw tin apantisi.
> >
> > Michalis Kabrianis
> > kabrianis at hellug.gr
>
>   O kyrios Stroustrup anaferei pvs sizeof (char) = 1 ej orismoy! Uymamai
> na 'xv dei kati paromoio kai gia th C, alla ayth th stigmh den to
> briskv.
>
>         Xrhstos
>

 xmmm ... to sizeof(char) einai panta 1 ( 8 bits) kai den allazei apo systhma se
systhma.
Auto omws pou allazei apo systhma se systhma einai to range tou char.
opws diabazw edw ...  se VAX kai  SUN ( einai ligo palio to biblio) pou parexoun
signed bytes, mia metablhth typou char exei range -128 ews 127.
Enw se IBM/370 arxitektonikh, pou parexei unsigned-bytes to range einai 0 - 255.
Kai prosthetei o sygrafeas (Horspool) ....
If you plan to transfer your C programs to other computers you have to be
careful in this regard.

Hlias-





--
====================================================================
Gia boithia (h na diagrafhte) e-mail sto majordomo at argos.hol.gr
Ta archives tis listas einai sto http://www.argos.hol.gr/lists :
prin steilete kapoia erothsh psakte mipos exei hdh apanththei.
Gia opoiodipote problima stilte e-mail ston owner-linux-greek-users
====================================================================



More information about the Linux-greek-users mailing list