Convert C++ to C

Thanks a lot
Last edited on
Please indent your code.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
//std::vector<double> r,v; //this should be valarray in the first place
double r[2], v[2];

//double operator*(const vector<double> &v1, const vector<double> &v2);
double dot_product2d(const double *v1, const double *v2);

//member functions
//bool Neutron::step_succeeded()
int Neutron_step_succeeded( Neutron *this ) //prefix all member with this->

// I/O
//FILE* instead of ofstream, f{open,close}
//{f,}printf for output
//scanf for input 
here is the word I have done so far, but the result is just not right. Can anyone help?

Last edited on
¿why did you remove the opening post?

For the undefined references, you need to link against math.
It would be `-lm' in gcc.

Also
1
2
Neutron *neutron;
initNeutron( neutron );
is wrong, `neutron' in uninitialized.
You should
1
2
Neutron neutron;
initNeutron( &neutron );
Topic archived. No new replies allowed.