From: Endlisnis Newsgroups: comp.os.msdos.djgpp Subject: Re: GCC and pointers : QUESTION Date: Wed, 5 Aug 1998 22:54:38 -0300 Organization: University of New Brunswick Lines: 12 Message-ID: References: <35bf1ff4 DOT 1246159 AT news DOT icm DOT edu DOT pl> NNTP-Posting-Host: sol-alt1.unb.ca Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII In-Reply-To: <35bf1ff4.1246159@news.icm.edu.pl> To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk On Wed, 29 Jul 1998, Inquisitor Nikodemus wrote: ->During writing a function I noticed that operations - such as addition ->or substraction - on pointers of different types than char didn't ->behave as I expected them to. Eg. adding 2 to the the pointer : -> short *pointer_to_short ; ->resulted in 4 byte offset,not 2 byte. Same for ints etc. ->So the question is : is it really a fact,that gcc's pointer math ->depends on type rather than raw bytes ? That's how it is in all ANSI C++ compilers. Endlisnis [I have a pyramid of wingyness]