Home > Back-end >  Don't understand why
Don't understand why

Time:09-19

First of all, I've set an array from the

Then tell from keyboard input to the array and the address to a function, there is a long cycle so I'm not cut out

Here is the following introduction I do

Then enter into the function

Program is crashed, and looking for a long time can't find the reason, so I can only see can someone do me a favor,

CodePudding user response:

Can look up the call stack? Or in your search string has several separators, one-time allocation splitstruct - & gt; The space of STR, don't apply again

CodePudding user response:

I think the incoming is the address of the input array, sizeof (input) and can't get the size of the array, only by the size of the pointer

CodePudding user response:

Array collapse, usually in the subscript crossing the line

CodePudding user response:

reference 1st floor focuslight response:
can look up the call stack? Or in your search string has several separators, one-time allocation splitstruct - & gt; STR space, don't again to apply for the
because every time is not the same as the input so I can't a distribution, also did not think I quite understand why the core dump

CodePudding user response:

refer to the second floor CHXCHXKKK response:
I think the incoming is the address of the input array, sizeof (input) and can't get the size of the array, only by the size of the pointer
with sizeof no relationship

CodePudding user response:

reference 3 floor is Simple - Soft reply:
array collapse, generally is the subscript cross-border
when I debug is realloc out problem, so I didn't want to know why

CodePudding user response:

An array, the sizeof the pointer, you can use strncpy or other disposal of the cross-border protection mechanism
  • Related