#: 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.
|