help-gsl
[Top][All Lists]
Advanced

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

[Help-gsl] C++ with gsl


From: Fred J.
Subject: [Help-gsl] C++ with gsl
Date: Sat, 22 Jul 2006 23:20:27 -0700 (PDT)

Hi

I have a bit of a delema, I am learning C++ while developing my own
through away toy program to make things more existing. I am also using
the gsl library, http://www.gnu.org/software/gsl/
which provides its API in C and not in C++, to call those C functions
in my C++ toy program, the library says;

2.10 Compatibility with C++

The library header files automatically define functions to have extern
"C" linkage when included in C++ programs. This allows the functions
to be called directly from C++. 

so for an example:

say you want to open a file to read its data into a matrix, gsl
provides
int gsl_matrix_fwrite (FILE * stream, const gsl_matrix * m)
the first argument is a C type and not a C++, which is confirmed by a gsl
example 
       {  
          FILE * f = fopen ("test.dat", "wb");
          gsl_matrix_fwrite (f, m);
          fclose (f);
       }
     
in such a case, am I have to learn C types instead of iostream I am
used to in C++?

thanks
     

                
---------------------------------
Groups are talking. We´re listening. Check out the handy changes to 
Yahoo! Groups. 


reply via email to

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