From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Colannino Subject: pointer arithmetic vs. arrays Date: Sat, 25 Feb 2006 18:05:51 -0800 Message-ID: <44010CFF.5040806@colannino.org> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: Sender: linux-c-programming-owner@vger.kernel.org List-Id: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: linux-c-programming@vger.kernel.org Hey everyone. I've heard (and have also read in "The C Programming Language") that pointer arithmetic in place of arrays is, in general, faster. However, I've also heard that modern compilers automatically make optimizations that account for this difference. In everyone's opinion, taking both readability and issues of speed into account, what is better to use? I'd imagine this would depend on the situation. Just trying to pick up better coding habits as I learn :) James -- My blog: http://www.crazydrclaw.com/ My homepage: http://james.colannino.org/ "If Carpenters made houses the way programmers design programs, the first woodpecker to come along would destroy all of civilization." --Computer Proverb