Re: char array to long

"Alexander Veit" <[email protected]>
Newsgroups gmane.linux.suse.programming
Message-ID <[email protected]>
Jan Hendrik Berlin schrieb:

> [...]
> Ich möchte nun ein Stück Code haben, was mir aus einem array, 
> was vier einzelne Bytes enthält, diesen long Wert zusammensetzt!
> Und ich habs schon probiert, aber ich hab da so meine Problemchen
> mit! Mein Code funktioniert nicht!

Endianess- und sonstige Problemchen außer Acht lassend:

 char c[4];
 long l;

 l = *(long*)c;

-- 
Gruß,
Alex


-- 
Um die Liste abzubestellen, schicken Sie eine Mail an:
    [email protected]
Um eine Liste aller verfügbaren Kommandos zu bekommen, schicken
Sie eine Mail an: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.