TIP: Click on subject to list as thread! ANSI
echo: locsysop
to: Paul Edwards
from: Bob Lawrence
date: 1996-11-08 08:18:24
subject: Special Requests

BL> strcpy(names[x][0], line); // ?? didn't work ??

 BL> What did I do wrong? 

 PE> That is referencing a single character. strcpy() requires a
 PE> pointer. Either &names[x][0] or better names[x] will do the
 PE> trick. BFN. Paul.

  Ahh! I didn't realise you could address an array like that. It's
obvious now that you'd have to...

  Are you saying that strcpy(names[x], line); will work?? How can it?
names[][] is a two dimensional array. I'll try it...

... [later]

  It *does* work. How?

  It must mean that a 2-dimensional array is really a one-dimensional
array of strings. What happens with a 3-dimensional array? If I had
names[x][y][z] can I put names[x] to address the [y][z] array? and
names[x][y] to address the z string? Whatta great idea!

  Another thing I don't quite understand is your use of things like 
char **whatever;

  You use it quite a bit.

  Does this mean it's a pointer to a pointer to a character? What's
the point of that? It's the same size, so what does the extra code 
gain? Why not just use the original pointer?

Regards,
Bob
 
___ Blue Wave/QWK v2.12
@EOT:

---
* Origin: Precision Nonsense, Sydney (3:711/934.12)
SEEN-BY: 711/934 712/610
@PATH: 711/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™.