From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: Xl.tags.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 30 Sep 2014 08:17:33 -0500 From: Dennis Lee Bieber Newsgroups: comp.lang.ada Subject: Re: actual for variable name must be variable compiler error Date: Tue, 30 Sep 2014 09:17:41 -0400 Organization: IISS Elusive Unicorn Message-ID: References: X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 108.73.119.10 X-Trace: sv3-2JHR8lw3ra/hSM7UfCBq2yjhSgFP46YaIoEsqWeLpr6mbpMRiFlVJnK82i93ecJd1k58FnKtxjYrsxO!wu4dI+xija7cLjXqMHfzKW2B6rjJmht2k8Vb8uAaZnEz51XgnaZYIsmdLboQFVfdPI3DpnAAiN4a!xzNKFyFe51XBJkEQNsCWLuNOPKw= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2169 Xref: number.nntp.dca.giganews.com comp.lang.ada:189252 Date: 2014-09-30T09:17:41-04:00 List-Id: On Tue, 30 Sep 2014 00:27:54 +0000 (UTC), Simon Clubley declaimed the following: >However, I want to make it clear I don't write production code like >that. If an in parameter needs modifying in a C program it gets copied >into a local variable and worked on there. Modifying an in parameter >in the way it's done in my example just feels so very wrong to me even >when the language lets you do it... > The main concept is that the parameter, in C, is effectively already a local copy... Changes don't propagate back out (unless one has explicitly declared it a pointer type and is doing dereferencing on the pointer; or a C++ reference parameter). In FORTRAN, it was always a reference and the compiler handled dereferencing for you. -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/