Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C > Re: strcpy ques...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 11 of 17 Topic 26073 of 26967
Post > Topic >>

Re: strcpy question

by "Default User" <defaultuserbr@[EMAIL PROTECTED] > May 5, 2008 at 11:16 PM

mdh wrote:

> On May 5, 2:34 pm, Tomas O hEilidhe <t...@[EMAIL PROTECTED]
> wrote:
> 
> > A function cannot take an array as a parameter. If you do the
> > following:
> > 
> >  
> 
> Sorry if I was unclear...as this is what I was trying to say. In other
> words, a function that expects an array, will in fact actually
> receive a pointer as a parameter.

A function does not and cannot "expect" an array. Even if you write the
declaration to look like an array to a human reading it, the function
expects nothing of the sort. It expects and receives a pointer.

void f(int p[50]);
void f(int p[1]);
void f(int *p);

The above are identical to the compiler.

> So, what I was concentrating on was
> the syntax where a pointer that had an array allocated to it ( ie was
> not an array that had been converted to a pointer as an argument to a
> function) is just as  legal a  construct under  as passing an array
> itself.

You can't pass an array, so yes they are equally valid. 



Brian
 




 17 Posts in Topic:
strcpy question
mdh <mdeh@[EMAIL PROTE  2008-05-05 11:19:59 
Re: strcpy question
Eric Sosman <Eric.Sosm  2008-05-05 14:39:35 
Re: strcpy question
=?ISO-8859-1?Q?Tom=E1s_=D  2008-05-05 11:39:39 
Re: strcpy question
David Thompson <dave.t  2008-05-19 03:59:51 
Re: strcpy question
Keith Thompson <kst-u@  2008-05-18 21:39:15 
Re: strcpy question
=?ISO-8859-1?Q?Tom=E1s_=D  2008-05-05 11:41:33 
Re: strcpy question
"Default User"   2008-05-05 18:47:03 
Re: strcpy question
mdh <mdeh@[EMAIL PROTE  2008-05-05 13:08:56 
Re: strcpy question
=?ISO-8859-1?Q?Tom=E1s_=D  2008-05-05 14:34:55 
Re: strcpy question
mdh <mdeh@[EMAIL PROTE  2008-05-05 16:04:37 
Re: strcpy question
"Default User"   2008-05-05 23:16:18 
Re: strcpy question
Keith Thompson <kst-u@  2008-05-05 16:23:24 
Re: strcpy question
mdh <mdeh@[EMAIL PROTE  2008-05-05 16:07:12 
Re: strcpy question
mdh <mdeh@[EMAIL PROTE  2008-05-05 16:52:00 
Re: strcpy question
Keith Thompson <kst-u@  2008-05-05 18:00:22 
Re: strcpy question
mdh <mdeh@[EMAIL PROTE  2008-05-05 16:52:33 
Re: strcpy question
mdh <mdeh@[EMAIL PROTE  2008-05-05 18:17:13 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 6:48:24 CDT 2008.