Mail Archives: djgpp/1998/09/28/00:56:51
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
- Raw text -