TIP: Click on subject to list as thread! ANSI
echo: cis.languages
to: Jim Peasley 72726,1153 (X)
from: Pete Lyall 76703,4230
date: 1990-12-02 15:00:12
subject: #8539-#`C` problem

#: 8540 S3/Languages
    02-Dec-90  15:00:12
Sb: #8539-#'C' problem
Fm: Pete Lyall 76703,4230
To: Jim Peasley 72726,1153 (X)

Jim -

Off the top:

Are you REALLY passing an ARRAY of characters to the function, or did you pass
a pointer to that array? If you called the function with the name of the array,
you passed a pointer:

   char junk[81];
   gets(junk);
   do_function(junk);

.. as in this scenario. It'll also be easier to manipulate (and faster) in the
target function. I've never passed an array in TC, but don't think you CAN
under MW C.

Also - on your reference to strncpy(), you said you were copying the 6th and
7th characters... you actually started the copy at the 7th character when you
did this: strncpy(target, source+6, 2);

Pete

There is 1 Reply.

SOURCE: compuserve via textfiles.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™.