Message-ID: <360F16AB.667D19B0@post.comstar.ru> Date: Mon, 28 Sep 1998 07:55:07 +0300 From: Dim Zegebart Reply-To: zager AT post DOT comstar DOT ru Organization: Comstar Ltd. MIME-Version: 1.0 To: Klaus Petzold CC: djgpp AT delorie DOT com Subject: Re: Why GPF? References: <360E58C8 DOT 1F87EAD1 AT wupperonline DOT de> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Precedence: bulk Klaus Petzold wrote: > unsigned char *t; > > unsigned char readchar(unsigned char *ptr) > { unsigned char a; > a = (*t); > return(a); > } First, if you don't allocate memory for t it points to the void. So, you either had to do t=(unsigned char*)malloc(1); or t=&unsigned_char_variable; Second, IMHO, your readchar() looks meaningless, if you need to return content of memory cell pointed by ptr you should alter code like next : unsigned char readchar(unsigned char *ptr) { return(*ptr); } -- Dim Zegebart Moscow, Russia