Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!sco!seanf From: seanf@sco.COM (Sean Fagan) Newsgroups: comp.lang.c Subject: Re: difference between 'char *arr' and 'char arr []' Message-ID: <8163@scolex.sco.COM> Date: 12 Oct 90 04:28:18 GMT References: <151805@felix.UUCP> <1990Oct4.234406.17473@alzabo.uucp> <49140@seismo.CSS.GOV> Sender: news@sco.COM Reply-To: seanf (Sean Fagan) Organization: The Santa Cruz Operation, Inc. Lines: 31 In article <49140@seismo.CSS.GOV> black@beno.CSS.GOV (Mike Black) writes: >"The expression E1[E2] is identical (by definition) to *((E1)+(E2))..." >2 paragraphs later, "...array names are CONVERTED to pointers" (my >emphasis). A seeming conflict for something that is identical. Uhm... no, it's not. The syntax E1[E2] works for pointers as well as arrays. The normal use is ArrayName [ expr ]; Now, since array names are converted to pointers, we get (ArrayName_as_Pointer) [ expr ]; which is the same as *((ArrayName_as_Pointer) + (expr)); Where's the conflict? Or don't people understand what was being said? (I opt for the latter, actually, but I tend to give novices one break 8-).) -- -----------------+ Sean Eric Fagan | "*Never* knock on Death's door: ring the bell and seanf@sco.COM | run away! Death hates that!" uunet!sco!seanf | -- Dr. Mike Stratford (Matt Frewer, "Doctor, Doctor") (408) 458-1422 | Any opinions expressed are my own, not my employers'.