Skip to content

Instantly share code, notes, and snippets.

@abinashmeher999
Last active August 29, 2015 14:23
Show Gist options
  • Select an option

  • Save abinashmeher999/f493bd1e0d233b0c95cf to your computer and use it in GitHub Desktop.

Select an option

Save abinashmeher999/f493bd1e0d233b0c95cf to your computer and use it in GitHub Desktop.
void basic_args(const basic a, const basic_struct*** array, int *size)
{
std::vector<RCP<const Basic> > args;
args = (*RCP_const_cast(a))->get_args();
*size = args.size();
*array = (const basic_struct**)malloc((*size)*sizeof(basic_struct*));
std::vector<RCP<const Basic>>::iterator it;
int index = 0;
for (it = args.begin(); it != args.end(); ++it) {
(*array)[index++] = reinterpret_cast<const basic_struct*>(&(*it));
char *str;
const basic_struct* b = (*array)[index-1];
str = basic_str(b);
printf("%p\n",&((*array)[index-1]));
// printf("%s ", str);
// basic_str_free(str);
}
// printf("%p",(*array+1));
}
//! Returns an array of pointers to basic given by args
void basic_args(const basic s, const basic_struct*** array, int *size);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment