Created
March 31, 2012 08:44
-
-
Save isag/2260967 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
double *tr_sp_array(ParamSP *p0) | |
{ | |
ParamSP *p = (ParamSP*)malloc(sizeof(ParamSP)); | |
memcpy((void*)p,(void*)p0,sizeof(ParamSP)); | |
double *param_sp = (double*)malloc(6*sizeof(double)); | |
param_sp[0] = (double)p->cycle_num; | |
param_sp[1] = (double)p->number; | |
param_sp[2] = (double)p->ab; | |
param_sp[3] = (double)p->pc; | |
param_sp[4] = p->input; | |
param_sp[5] = p->mass; | |
free(p); | |
return param_sp; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't like this code for a couple of reasons, you could avoid both malloc. I'll fork it...