Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Getting back into C programming



> 
> Message: 1
> Date: Tue, 5 Dec 2006 11:17:21 +0900
> From: Al Hoang <hoanga@example.com>
> Subject: Re: [tlug] Getting back into C programming
> To: Tokyo Linux Users Group <tlug@example.com>
> Message-ID: <20061205021721.GY9438@example.com>
> Content-Type: text/plain; charset=us-ascii
> 
> On Tue, Dec 05, 2006 at 11:02:44AM +0900, Andrew Hamilton wrote:
> > On Mon, Dec 04, 2006 at 05:23:20PM -0600, Stuart Luppescu wrote:
> > > that I cribbed from Numerical Recipes. The definition (? 
> first line 
> > > of the function) looks like this:
> > > 
> > > float ran0(int &idum)
> > > the declaration like this:
> > > 
> > > float ran0(int &);
> > 
> > Are you sure you don't mean (int* idum)?
> > 
> >  - awh
> 	Depends if he's using C++ or C semantics in this case.  
> Josh's suggestion for g++ should fix up the C++ stuff.  I 
> guess if Stuart could post the code somewhere (if that's 
> possible) so it's easier to see this function in context I 
> wouldn't mind taking a shot and trying to get it 
> to compile.  Getting it to work I'll leave up to him :-)
> Alain

Also depends on what one wants the function to do.

void func(int &a){a++; return;}

For instance would take an integer without any special  notation and
increment it.

void func(int * a) {a++; return;}
Theoretically does the same thing, but wants either a pointer to an int,
or an integer specifically notated as &a.


Of course my logic is based more off of C++.


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links