Am Donnerstag, 16. August 2001 17:19 schrieben Sie:
On Thu, Aug 16, 2001 at 09:52:50PM -0400, Stephan Goetter wrote:
Am Mittwoch, 15. August 2001 12:47 schrieben Sie:
Also ich nicht...
Arrays und Pointer in C mischen macht irgendwie keinen Spass.
Wieso, ich dachte Arrays und Pointer in C wären das gleiche :)
Ihr Compiler schon ab und an mit Optimierung und innerhalb einer Funktion.
#include <stdio.h> int main(){ char a[] = "hello"; char *p = "world"; putchar(a[3]); putchar(p[3]); }
.file "test.c" .version "01.01" gcc2_compiled.: .section .rodata .LC0: .string "hello" .LC1: .string "world" .text .align 16 .globl main .type main,@function main: pushl %ebp movl .LC0, %eax movl %esp, %ebp subl $36, %esp movl %eax, -24(%ebp) movw .LC0+4, %ax movw %ax, -20(%ebp) movsbl -21(%ebp),%eax pushl %eax call putchar movsbl .LC1+3,%eax movl %eax, (%esp) call putchar leave ret .Lfe1: .size main,.Lfe1-main .ident "GCC: (GNU) 2.96 20000731 (Linux-Mandrake 8.0 2.96-0.48mdk)"