help-gsl
[Top][All Lists]
Advanced

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

[Help-gsl] Declaring GSL_Vector Globally


From: m . p . boulton
Subject: [Help-gsl] Declaring GSL_Vector Globally
Date: Wed, 15 Aug 2007 13:20:05 +0100
User-agent: Internet Messaging Program (IMP) 3.2.1

Hello. Is it possible to declare a GSL Vector globally without declaring it at
the very beginning of the code before main?

Basically I have tried using extern as I usually do with integer variables,
however since the GSL Vector seems to be declared and initialised all in one
line, I can't seem to declare it at the beginning of the code, then declare it
as external when I initialise it. For example:

#include <stdio.h>

int num;

int main()

{

  extern int num;
  num = 10;
  return 0;

}

is my usual method, but using this with GSL vectors as follows:

#include <stdio.h>
#include <gsl/gsl_vector.h>

gsl_vector *check_vec;

int main()

{

  int ncomp;

  ncomp = 100;

  extern gsl_vector *check_vec = gsl_vector_calloc( ncomp + 1 + 100 );
  return 0;

}



will not work.

Kind Regards,

Matt




reply via email to

[Prev in Thread] Current Thread [Next in Thread]