recommendations of email account providers or have a go at my C question.

Tim Borgeaud Tim.Borgeaud at bristol.ac.uk
Thu Jun 21 16:03:06 BST 2001


My old University account is about to expire. So I'm looking for 
a new email account somewhere. I'd love shell/web/ftp services but
a simple email account would do. 

The account would be for personal and FreeBSD list related email.
I'd like to be able to enable some kind of filtering (on the host
machine) and to be able to get my email easily from home and work 
so I'd prefer not to use POP.





Here's the C question - it's not really a problem but I'd like to
know if something can be done or not (I suspect not).

Imagine I have a data array or some sort and a void pointer to this
data:

void *My_data;

Now suppose that the data is a series of 2 byte integers (short). 
I decide that I want one of these integers found at an offset.

 ((short *)My_data + offset) is then the pointer to this integer. 

Now I have a function foo which is defined as

double foo(int *bar);       the int is 32bit

I'd like to use the My_data array and offset directly (no matter 
how ugly the code looks) :

foo(  &((int)*((short *)My_data + offset))

But I can't do this because of the cast from short to int.
I can't use the & operator on the casted data - 
 (int)*((short *)My_data + offset) is not an l-value.

I am assuming this is equivalent of something like

foo( &(atoi("10")) );   

But is there something about casts that I don't know that would allow
another way of doing this?


Tim




















More information about the Ukfreebsd mailing list