Deleting an unused variable makes my code seg fault....
@aproposIn C, can I have an array of strings and then do strcpy into it like strcpy(strings[i], str)?
@matrix @apropos if you have adequate space in the destination buffer, then yes. Also don’t forget about the null terminator.
@VD15 @apropos Doesn't strcpy insert that?
@apropos @VD15 It has that so the problem is elsewhere
@matrix @apropos It copies it over, if that’s what you mean, but it doesn’t create one if it doesn’t exist.
@VD15 @apropos I think it might be something here
#include #include int main(void) { char strs[2][3] = {"ab", "cd"}; strcpy(strs[0], "xx"); printf("%s\n%s\n", strs[0], strs[1]); }
@GlowieI don't know
Mainly gaming/nerd instance for people who value free speech. Everyone is welcome.