cvs.gedasymbols.org/archives/browse.cgi | search |
From: | Endlisnis <s257m AT unb DOT ca> |
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: | <Pine.SOL.3.96.980805225348.734A-100000@sol.sun.csd.unb.ca> |
References: | <35bf1ff4 DOT 1246159 AT news DOT icm DOT edu DOT pl> |
NNTP-Posting-Host: | sol-alt1.unb.ca |
Mime-Version: | 1.0 |
In-Reply-To: | <35bf1ff4.1246159@news.icm.edu.pl> |
To: | djgpp AT delorie DOT com |
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
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]
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |