Hi! I have this:
char taskCompleteUrl[22] = "tasks/";
char taskID[10];
scanf("%s", taskID);
strcat(taskCompleteUrl, taskID);
strcat(taskCompleteUrl, "/close");
printf("%s\n", taskCompleteUrl);
Assuming the user enters 1234567890, printf outputs 1234567890/close, when I expect it to output tasks/1234567890/close. Why is this?
If I remove the line with scanf and manually set taskID equal to 1234567890, I get this string: tasks/1234567890tasks/1/close as well as a stack smashing error (which is similar to stack overflow, I think?)