#: 8568 S3/Languages
03-Dec-90 08:53:21
Sb: #8553-#'C' problem
Fm: Pete Lyall 76703,4230
To: Jim Peasley 72726,1153 (X)
Jim -
If you're passing the NAME of the array, then that's automatically a pointer to
the array:
saying: assuming: char myarray[81];
saying : myarray is the same as &myarray[0]
So, if you called a function with 'myarray like so:
do_it(myarray);
You'd need to declare it at the receiving end like this:
do_it(stuff)
char *stuff; /* myarray arrived as a pointer to the base of itself*/
{
char woof[3];
strncpy(woof,myarray+5, 2); /* grab chars 6 & 7 */
....
}
Pete
There is 1 Reply.
|