TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: KURT KUZBA
from: MIKE LUTHER
date: 1998-02-15 08:48:00
subject: Re: Help with multi-dim chara

Thank you Kurt, 
 
 > KK: TH> ML>   DIM K$(100) AS STRING * 256 
 
 > KK:    That would be K[100][256]; :) 
 
 > KK:    Better off using dynamic allocation on that. 
 
I understand.. the only reason I thought otherwise was that in this 
particular case the data array is going to be in near constant use in the 
entire run length of the program.  Further, it is going to be pretty full the 
entire time.  As well, for the future, I can see that multiple threads may 
need access to the elements of the array.  That gave me the view that if I 
was going to create and destroy it over and over, just to keep track of the 
changes in the ragged boundaries of the elements, I might wind up having to 
worry about that during multiple thread use of the data.. 
 
 > KK:    Making a class of it removes the need of a loop to 
 > KK:    initialize and destruct your string arrays. 
 
I understand...  plus, for what little I understand of this so far, that also 
permits me to declare a portion of the class as public as well. 
 
 > KK:    In addition to this, you have the ability to add all sorts 
 > KK:    of useful string handling routines to your class, such as 
 > KK:    overloaded assignment using =, overloaded concatenation using 
 > KK:    +, mid, left, right, trunc, pad, uppercase, lowercase, and 
 > KK:    comparison with or without case sensitivity using ==. 
 
 
 > KK:    You can have it accept int, long, float, char, char*, and 
 > KK:    anything else, including specialty items specific to your 
 > KK:    application, such as a specific struct or data type. 
 > KK:    This is where C++ really shines over C. You can construct a 
 > KK:    class to handle the creation and maintenance of strings or 
 > KK:    other data objects, and not need to construct the code for 
 > KK:    every instance of the use of that type of object, as you 
 > KK:    would with the first example, using a loop to initialize 
 > KK:    an array of strings. 
 
Seems coherent to me at this point.  At one time in playing with this I 
actually had a class implement for it., however the same error in compile 
time showed up in the call statement for the function that showed up in the 
other ways I tried it, but I've learned a bit more so  .. back to class.. :>) 
 
Slowly I'm learning how I might reasonably implement this thing. 
 
As to the comment in the thread of why Watcom++, I happen to have it. It 
appears as if some of the things I may need are in NLM output as well as even 
back to DOS 32 bit code.  It may not be the best tool I could have picked, 
but it looked to me as if it covered more output op systems in one package 
than anything else and I'm very much stuck into having to thing about native 
OS/2 as well... thus...  I bought in... 
 
So far, other than this learning step, I've had no trouble with it, and 
further, the entire operation worked with the code in main... 
 
I make no pretense to know much of anything about C++  .. 
 
     or, heritically speaking, in this echo.. :)  C--  :) 
 
Mike @ 117/3001 
--- Opus-CBCS 1.73a
---------------
* Origin: Ziplog Public Port (1:117/3001.0)

SOURCE: echomail via exec-pc

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