Hello riches,
Thank you. If my code was so simple as I mentioned above, it works.
Here are my some messy codes. I dont know where I was wrong.
Code:
int string_length =0;
char** end_ptr = NULL;
char* tempString = NULL;
char* second_part_of_tempString = NULL;
double x = 0;
fucntion print_stack()
{
for ( int i = 0; i < 10 ; i++)
{
string_length = strlen(stack_arrary[i]); // "123 456" in stack_arrary[i]
tempString = malloc(string_length+1);
strncpy(tempString,stack_arrary[i],string_length); // "123 456" in tempString
tempString[string_length] = '\0';
second_part_of_tempString = strstr(tempString," "); // " 456" in second_part
x = strtod(&second_part_of_tempString[1],end_ptr);
}
Code:
> error
2108 _cygtls::handle_exceptions: Error while dumping state (probably corrupted stack)
segmentation fault (core dumped)