22 #include "headcpp.hpp"
63 int n_int_nouveau = index + 1 ;
64 int* p_int_nouveau =
new int[n_int_nouveau] ;
66 for (
int i=0 ; i<
n_int ; i++)
67 p_int_nouveau[i] =
p_int[i] ;
68 p_int_nouveau[index] = ti ;
72 p_int = p_int_nouveau ;
73 n_int = n_int_nouveau ;
77 if (
p_int[index] != 0) {
78 cout <<
"Param::add_int : the position " << index
79 <<
" is already occupied !" << endl ;
95 assert(index <
n_int) ;
97 return (
p_int[index]) ;
121 int n_double_nouveau = index + 1 ;
122 double* p_double_nouveau =
new double[n_double_nouveau] ;
126 p_double_nouveau[index] = ti ;
135 cout <<
"Param::add_double : the position " << index
136 <<
" is already occupied !" << endl ;
int n_double
Number of double 's (double precis.
Param()
Default constructor is the only constructor.
int get_n_double() const
Returns the number of stored double 's addresses.
int * p_int
Array (size n_int ) of the int 's addresses.
int n_int
Number of int 's (integers).
double * p_double
Array (size n_double ) of the double 's addresses.
void add_double(double x, int position=0)
Adds the the address of a new double to the list.
void add_int(int n, int position=0)
Adds the address of a new int to the list.
const double & get_double(int position=0) const
Returns the reference of a double stored in the list.
const int & get_int(int position=0) const
Returns the reference of a int stored in the list.
int get_n_int() const
Returns the number of stored int 's addresses.