TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: Neil Heller
from: George White
date: 1998-09-17 22:34:12
subject: C.L.C Faq, Abridged (1/4

Hi Neil,

You asked:

NH>TT> 2.2:   Why doesn't "struct x { ... }; x thestruct;" work?
NH>TT>
NH>TT> A:   C is not C++.

NH>That seems like a Microsoft-type answer (correct without saying
NH>anything).  Anyway, am I correct in assuming that all that's needed in
NH>the above is the addition of the word "struct" before the
"x" in the
NH>second statement?

It's complete enough for me.

NH>TT> 6.9:   Someone explained to me that arrays were really just
NH>TT>  constant pointers.
NH>TT>
NH>TT> A:   An array name is "constant" in that it cannot
be assigned to,
NH>TT>    but an array is *not* a pointer.

NH>In the code:

NH>int a[10];
NH>a = 10;

NH>Doesn't a[0] now hold the value 10?

No. As the answer given says, it's an illegal operation. The compiler
should report an error. BC 3.1 gives the error "Lvalue required". Try it
with your copiler and see.

George

 * SLMR 2.1a * Computers eliminate spare time.

--- Maximus/2 3.01
* Origin: DoNoR/2,Woking UK (44-1483-717904) (2:440/4)
SEEN-BY: 396/1 622/419 632/0 371 633/260 267 270 371 634/397 635/506 728 810
SEEN-BY: 639/252 670/218
@PATH: 440/4 255/1 251/25 396/1 633/260 635/506 728 633/267

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™.