| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | charasters arrays that ar |
DC> Now, I have had all sorts of problems using malloc to DC> allocate space for a character array, so I would instead DC> like to forget about using malloc, While that may get you around the current difficulty, it won't help towards your understanding of the use of malloc() I've done the same thing on many occasions, and regretted it. Later, when I finally bit the bullet and set out to conquer the thing which had my cowed, it turned out to be a good deal simpler than my perceptions had colored it. I DID have trouble with pointers and dynamic allocation and am given to understand that this is not at all uncommon, so I don't feel too bad about it. :) If you saw my posting of I_READ_ME.C then you should be able to figure out how to use an array of char pointers and malloc() to read an array of strings. A 2D char array will work, yes, but it seems only that your understanding of pointers is incomplete. char List_of_Strings[30][16]; /* This provides 30 16-char strings. */ strcpy(List_of_Strings[0], "String 0"); /* Look up strcpy() in your online help */ fgets(List_of_Strings[0], 16, Datafile); /* Look up fgets() in your online help */ --- > ]* Origin: *YOPS ]I[* 8.4 GIG * RA/FD/FE * Milwaukee, WI (1:154/750) SEEN-BY: 396/1 632/0 371 633/260 267 270 371 634/397 635/506 728 810 639/252 SEEN-BY: 670/218 @PATH: 154/750 222 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™.