**ft_split(char const *s, char c), segmentation fault

It is my 3rd file where I am trying to solve this function. Its task is to split the string *s with delimiter "c" and save it in new malloc. I am getting segmentation fault, gdb shows it happens after i get from line 57 (big = malloc...) to line 63 (big[i][j] = s[i]).

I will save you information about how frustrated I am :(. Below the function. I would appreciate help because I like to understand how to solve something instead of just copying it from internet. The function written by myself.

ft_print - it is suppose to show me the result because when i try to use printf(%s, ft_split(a, 'z')); it produces some error.

The first image shows the whole function, [1]: https://i.stack.imgur.com/S1iEW.png Second image is focused on part of code where i think there is an error, so its bigger due to less lines[2]: https://i.stack.imgur.com/m3oIQ.png

Thank you and sorry i do not know how to correctly post live code here :(



Read more here: https://stackoverflow.com/questions/66324854/ft-splitchar-const-s-char-c-segmentation-fault

Content Attribution

This content was originally published by Tony at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: