help-gsl
[Top][All Lists]
Advanced

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

Re: [Help-gsl] error with gsl_randist.h


From: Brian Gough
Subject: Re: [Help-gsl] error with gsl_randist.h
Date: Tue, 25 Jan 2005 15:27:49 +0000

Pau Cervera Badia writes:
 > If I include my macro definition for N just before the header file 
 > there's no problem because cpp is only goning to substitue the Ns just 
 > before the macro, but not the one's before it, am I right?

Generally you should put definitions after #includes due to the
problem you have seen.  The conventional order is:

    /* system header files */
    #include <stdio.h>

    /* library header files */
    #include <gsl/gsl_randist.h>

    /* application header files */
    #include "myapplication.h"

    /* macro definitions */
    #define N 1234

Also, it is often better to use a constant global variable instead of
a preprocessor definition as you can examine the value of a variable
in the debugger but not a macro definition.

-- 
best regards,

Brian Gough

Network Theory Ltd,
Publishing Free Software Manuals --- http://www.network-theory.co.uk/




reply via email to

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