You are here: Re: which language allows you to change an argument's value? « PHP Programming Language « IT news, forums, messages
Re: which language allows you to change an argument's value?

Posted by Summercool on 09/30/07 16:49

On Sep 30, 4:18 am, 7stud -- <dol...@excite.com> wrote:
> SpringFlowers AutumnMoon wrote:
> > we have no way
> > of knowing what we pass in could get changed.
>
> Sure you do. You look at the function's signature. In order to use
> someone else's library, you have to know the function's signature. And
> the signature explicitly tells you whether the value you pass in could
> be changed.

do you mean in C++? I tried to find signature in two C++ books and it
is not there. Google has a few results but it looks something like
prototype. Is signature the same as the function prototype in the .h
file? If so, don't we usually just include <___.h> and forget about
the rest. Documentation is fine although in some situation, the
descriptions is 2 lines, and notes and warnings are 4, 5 times that,
and the users' discussing it, holding different opinion is again 2, 3
times of that length. I think in Pascal and C, we can never have an
argument modified unless we explicitly allow it, by passing in the
pointer (address) of the argument.

also i think for string, it is a bit different because by default,
string is a pointer to char or the address of the first char in C and C
++. So it is like passing in the address already. it is when the
argument n is something like 1 that makes me wonder.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация