[pso] Intrebare (masina big-endian)

mE me_registered at yahoo.com
Tue Sep 30 17:37:06 EEST 2008


:) same answer here



----- Original Message ----
From: Alexandru Moşoi <brtzsnr at gmail.com>
To: laurentiu.duca at cs.pub.ro; Proiectarea Sistemelor de Operare <pso at cursuri.cs.pub.ro>
Sent: Tuesday, September 30, 2008 5:26:44 PM
Subject: Re: [pso] Intrebare (masina big-endian)

2008/9/30 Laurentiu-Cristian Duca <laurentiu.duca at mail.cs.pub.ro>:
> Buna ziua,
>
>   Am nevoie de un sfat.
> Pe o masina big-endian,
> char *str="abcd";
> str[0]==(*str) este 'd' // nu este 'a'.

da?
eu stiam ca bigendian se refera la asezarea byteurile intr-un numar
intreg (gen int32_t) si nu intr-un sir. pentru siruri ordinea nu
trebuie sa se schimbe.

daca ai facut ceva de genul:
int a = 45354;
char *str = (int*)&a; s-ar putea sa ai surprize de genul celor de mai
sus, altfel nu vad cum ai obtinut 'd' in loc de 'a'.

oricum, e posibil sa gresesc eu...


-- 
Alexandru Moşoi
http://alexandru.mosoi.googlepages.com

Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html
_______________________________________________
pso mailing list
pso at cursuri.cs.pub.ro
http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/pso



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cursuri.cs.pub.ro/pipermail/pso/attachments/20080930/0198bf52/attachment.html 


More information about the pso mailing list