This simple code was nicely working:
Then I made some changes in the string:
char *source_str = "Some message here.\n";
char str[strlen(source_str) * 2];
for(i=0; i<5; i++)
Now, when I try to run this program, system replies: "Segmentation fault"
char *source_str = "Some message here."
" Let's make it even longer."
" Let's add another sentence.\n";
What actually causes this an what would be the alternatives?