This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: multiple defintions error
- To: Kriang Lerdsuwanakij <lerdsuwa at scf-fs dot usc dot edu>
- Subject: Re: multiple defintions error
- From: Atif Shahab <atif at viewinternet dot com dot sg>
- Date: Wed, 4 Oct 2000 16:40:25 +0800 (SGT)
- cc: gcc at gcc dot gnu dot org
On Wed, 4 Oct 2000, Kriang Lerdsuwanakij wrote:
>
> On Wed, 4 Oct 2000, Atif Shahab wrote:
>
> > if I do the following mapping it doesnt work.
> >
> > struct dummy1 *d1 = (struct dummy1 *) p;
> >
> > struct dummy2 *d2 = (struct dummy2 *) (d1 + sizeof( struct dummy1 ));
> >
>
> What you want is (struct dummy2 *) (d1 + 1).
> Since d1 is a pointer to struct dummy1, adding 1 to d1 automatically
> advance the pointer by the size of struct dummy1. gcc behaves
> correctly. The better place to ask this kind of question is in
> comp.lang.c newsgroup.
>
Ok, just did that thanks ;).
> --Kriang
>
>
>
--
Atif Shahab
Network Engineer
ViewInternet.com
Office Tel: +65 232 8877
DID: +65 232 8625
Office Fax: +65 232 8638
www.viewinternet.com.sg
******************************************************
Check your email from anywhere using www.viewemail.com
******************************************************