|
|
RE: Backwards File Dump #8
C doesn't have strings that is a char array.
>-----Original Message-----
>From: JF Mezei [mailto:jfmezei.spamnot@istop.com]
>Sent: Monday, November 24, 2003 5:46 PM
>To: Info-VAX@Mvb.Saic.Com
>Subject: Re: Backwards File Dump
>
>
>Tom Linden wrote:
>> Now if you store the string 'DEADBEEF'B4 on say a VAX in location
>> byte n this is what will appear in memory
>
>Depends on how you define and then "store" those 4 bytes.
>
>If I use C for example, and I have
>
>char mystring[4] = 0xDEADBEEF ;
>long myint = 0xDEADBEEF ;
>
>The first one will be stored in the same order as you typed it in. For the
>second one, the compiler will reverse the constant and store it
>as little endian.
>
>
>if you then use memcpy (&myint, &mystring, 4), then myint will contain
>"deadbeef" in the big endian order because the code in memcpy
>copies byte by
>byte without any endianness knowledge.
>
>---
>Incoming mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.542 / Virus Database: 336 - Release Date: 11/18/2003
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.542 / Virus Database: 336 - Release Date: 11/18/2003
|
|
0
|
|
|
|
Reply
|
tom284 (1837)
|
11/25/2003 2:17:59 AM |
|
Tom Linden wrote:
>> JF Mezei jfmezei.spamnot@istop.com wrote
>> Tom Linden wrote:
>>> Now if you store the string 'DEADBEEF'B4 on say a VAX in location
>>> byte n this is what will appear in memory
>>
>> Depends on how you define and then "store" those 4 bytes.
>>
>> If I use C for example, and I have
>>
>> char mystring[4] = 0xDEADBEEF ;
>> long myint = 0xDEADBEEF ;
>
> C doesn't have strings that is a char array.
Excuse me? (zero terminated) char arrays are the *only* strings
that exist in the C RTL.
cu,
Martin
--
OpenVMS: | Martin Vorlaender | VMS & WNT programmer
The operating system | work: mv@pdv-systeme.de
God runs the | http://www.pdv-systeme.de/users/martinv/
earth simulation on. | home: martin@radiogaga.harz.de
|
|
0
|
|
|
|
Reply
|
mv (279)
|
11/25/2003 7:54:13 AM
|
|
"Tom Linden" <tom@kednos.com> wrote in message news:<CIEJLCMNHNNDLLOOGNJIMEIFIIAA.tom@kednos.com>...
> C doesn't have strings that is a char array.
>
>
> >-----Original Message-----
> >From: JF Mezei [mailto:jfmezei.spamnot@istop.com]
> >Sent: Monday, November 24, 2003 5:46 PM
> >To: Info-VAX@Mvb.Saic.Com
> >Subject: Re: Backwards File Dump
> >
> >
> >Tom Linden wrote:
> >> Now if you store the string 'DEADBEEF'B4 on say a VAX in location
> >> byte n this is what will appear in memory
> >
> >Depends on how you define and then "store" those 4 bytes.
> >
> >If I use C for example, and I have
> >
> >char mystring[4] = 0xDEADBEEF ;
> >long myint = 0xDEADBEEF ;
> >
> >The first one will be stored in the same order as you typed it in. For the
> >second one, the compiler will reverse the constant and store it
> >as little endian.
> >
> >
> >if you then use memcpy (&myint, &mystring, 4), then myint will contain
> >"deadbeef" in the big endian order because the code in memcpy
> >copies byte by
> >byte without any endianness knowledge.
> >
> >---
> >Incoming mail is certified Virus Free.
> >Checked by AVG anti-virus system (http://www.grisoft.com).
> >Version: 6.0.542 / Virus Database: 336 - Release Date: 11/18/2003
> >
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.542 / Virus Database: 336 - Release Date: 11/18/2003
This thread is in serious need of a humor break.
The first thing that went through my mind when I saw the title was:
If you do a Backwards File Dump do you get satanic binaries?
WWWebb
========================
William W. Webb- EMS Operations,
OpenVMS Systems Support
USPS DSSC Annex - 4730 Hargrove Road
Raleigh, NC 27616-2874 919.325.7500x4186
* * * - email is first initial last name at email stop usps stop gov
|
|
0
|
|
|
|
Reply
|
al5vf03p02 (45)
|
11/25/2003 3:48:51 PM
|
|
"William Webb" <al5vf03p02@sneakemail.com> wrote in message
news:d5ce4b06.0311250748.2d48b2a2@posting.google.com...
>
> This thread is in serious need of a humor break.
>
> The first thing that went through my mind when I saw the title was:
>
> If you do a Backwards File Dump do you get satanic binaries?
>
No, but you will find out where Paul is buried.
|
|
0
|
|
|
|
Reply
|
John
|
11/25/2003 7:54:03 PM
|
|
|
3 Replies
41 Views
(page loaded in 0.079 seconds)
|
|
|
|
|
|
|
|
|