Path: chuka.playstation.co.uk!news From: Patrik Buckau Newsgroups: scee.yaroze.programming.3d_graphics Subject: Re: reading a byte from memory Date: Mon, 31 Aug 1998 21:05:55 +0200 Organization: PlayStation Net Yaroze (SCEE) Lines: 37 Message-ID: <35EAF413.AA31A8D@hajtech.se> References: <35E033B4.838F9761@hi.is> <35e07503.301962@news.playstation.co.uk> NNTP-Posting-Host: du154-246.ppp.algonet.se Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.05 [en] (Win95; I) Richard Cutting wrote: > On Sun, 23 Aug 1998 16:22:28 +0100, Ari Pall Albertsson > wrote: > > >hi! > > > >How do I read a byte from memory? Say that I wanted to know what byte is > >in memory location 0x801A0012. How can I read it? > > > >thanks > > Ari Pall > > > > You should be able to get it with something like; > > byte = *( ( u_long * ) 0x801A0012 ); > As far as me and good old mr ANSI are concerned a char* should be a pointer to a byte not an u_long* (the later should need an explicit typecast to fit in the variable "byte" above assuming the variable byte is defined as a char or u_char both of wich are one byte wide/large). Regards, Patrik > I'm not sure what you'd define 'byte' as though...int, long, u_long > ??? > > Richard. > http://www.netyaroze-europe.com/~rcutting