TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: PAUL EDWARDS
from: ADAM FITZPATRICK
date: 1996-05-17 20:53:00
subject: indirection

Paul Edwards wrote at All:



PE>int *x;

PE>int y;

PE>y = 3 * x;

PE>y = * x;

PE>y = *x;



PE>Which ones do you reckon are legal?



PE>I am wondering how mulitplication and indirection are distinguished between.



The first one is multiplication, and the other two are indirection. The first

has a number (which could obviously be a variable or a function or whatever)

before the * and the other two don't.



PE>Is the space significant?



Not AFAIK. (BTW, the y=3*x doesn't compile, because you can't multiply a

pointer by 3. y=3*(*x) would work [parentheses are for clarity, and it

compiles just as well without them].)



... Lose not thy airspeed lest the ground rise up and smite thee!

--- FMailX 1.02
* Origin: Power BBS - +61-2-858-4114 - Files/Games/EchoMail/Internet (3:711/953)
SEEN-BY: 50/99 620/243 623/630 711/401 409 410 413 430 808 809 932 934 946
SEEN-BY: 711/953 963 712/515 713/888 714/906 800/1
@PATH: 711/953 410 808 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.