| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Array Problem |
GD> On 01 Jan 99 06:50:00, Jasen was going on about "Array Problem"...
GD> JB> char a[5][5]={"x#xxx","x###x"... etc.
GD>
GD> That will only work of you use
GD> char a[5][5]={'x','#','x','x','x', 'x','#','#','#','x'... etc.
GD> instead of strings...
JB> Here both behave in the same way, does the standard say otherwise?
GD> OK, "123" needs 4 characters because of the terminating
null, '1', '2',
GD> '3' just needs the 3 chars declared...
GD> Hope that makes sense.
It makes sense ... until you realize that the standard says that _char
foo[3] = "123";_ will create a three character array consisting
of '1', '2', and '3' without the terminating nul. :-)
---
* Origin: Tanktalus' Tower BBS (1:250/102)SEEN-BY: 396/1 632/0 371 633/260 262 267 270 371 634/397 635/506 728 639/252 SEEN-BY: 670/218 @PATH: 250/102 201 99 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™.