let us investigate parachuting code in C++ together

Dear Friends,
My supervisor gave me a code about parachuting modelling and told me to go and understand it. I read the C++ book written by Schildt. What is your opinion I code step by step here the n we investigate it together. in this part *x and *u are the pointers but why did he define them here?


part 1:
function to integrate equation dx/dt=u using Crank-Nicolson
void solve_x(double *x, double *u, double dt, int time_step){

x[time_step+1]=(dt/2)*(u[time_step+1] + u[time_step]) + x[time_step];

}
Last edited on
x and u are arrays. You see that because of the []. pointer and array are closely related.
Further more x takes the result of a calculation.
spring2014 wrote:
I read the C++ book written by Schildt.
*Shudders*
Topic archived. No new replies allowed.