TIP: Click on subject to list as thread! ANSI
echo: locsysop
to: Paul Edwards
from: Bob Lawrence
date: 1996-11-05 10:31:20
subject: Special Requests

BL> names: array[0..128] of string[12];

 PE> char names[129][13]; ???

 BL> I did that, but it was a total shambles to use.

 PE> For example? BFN. Paul.

  I read a pointer (line) out of files.txt and then I had to copy it
to the array so I had it stored somewhere real in memory...

strtok(line, " ");               //first space is end of name
line[13] = '\0';                 //make sure it doesn't overflow  
strcpy(names[x][0], line);       //  ?? didn't work ??

  What did I do wrong? The only alternative was to use a loop to copy
the first 12 characters from line into the array, and that was the
shambles of which I spoke.

  So I made names[] an array of pointers and allocated memory using
malloc().

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