| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | indirection |
-=> Quoting Paul Edwards to All <=- PE> int *x; PE> int y; PE> y = 3 * x; is illegal - the only legal arithmetic operations on pointers are:- addition or subtraction of an integer (including increment/decrement) the difference between pointers. PE> y = * x; PE> y = *x; are equivalent, whitespace is ignored. (As I am quite sure you already know.) PE> I am wondering how mulitplication PE> and indirection are distinguished between. This is interesting. I have never written a c compiler, but it couldn't be too different to parsing BASIC, Forth or assembler for that matter. First identify primary expressions, then test (right to left) for valid unary operators ... Here the primary expression "x" is a pointer, therefore the "*" must bind with it. --- Blue Wave/386 v2.30* Origin: Sydney PC Users Group Mail Exchange (3:712/505) SEEN-BY: 50/99 620/243 623/630 711/401 409 410 413 430 808 932 934 712/311 SEEN-BY: 712/390 407 411 505 506 515 517 617 624 704 820 713/888 714/906 SEEN-BY: 800/1 @PATH: 712/505 517 515 711/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™.