[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-gsl] extern vector
From: |
Joakim Hove |
Subject: |
Re: [Help-gsl] extern vector |
Date: |
Fri, 18 Mar 2005 09:13:43 +0100 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.2 (gnu/linux) |
George Kyriakou <address@hidden> writes:
> Hello all,
>
> it may be a simple question:
>
> 1. In the code below (that compiles cleanly) I pass two variables by
> value in a function that takes pointers as arguments, and I still get
> the desired results. Is this normal?
Well, assuming you talk of the AlterVector function, it expects a
pointer and you pass a pointer. v1 and v2 are *pointers* to gsl_vector
"objects".
> 2. How could I access vector v2 within AlterVector ? The commented
> line produces "Undefined symbols: _v2".
Well, personally I would do it with the following function header:
void AlterVector(gsl_vector *v1, const gsl_vector *v2) {
/* Code altering v1 and *only* reading v2.*/
}
--
Joakim Hove
hove AT ift uib no
Tlf: +47 (55 5)8 27 90
Fax: +47 (55 5)8 94 40
http://www.ift.uib.no/~hove/