Since now I'm programming on my Maze game for College. I am almost ready. Just need to beautify it.
Here I thought 'bout making a setTitle function. Whenever testing it, it had some strange symptomps I've never seen.
So if I hardcode the title[255] array, title will be appended onto the cmd array. When setting the title as parameter in the function, and I give the value over to setTitle(char title[255]) (e.g. "* MAZE RUNNER*"), the program crashes.
I've tried different array sizes, but this symptom seems to appear randomly.
Maybe a beginner fault at my side?
void setTitle(char title[255]) {
char cmd[] = "title ";
strcat(cmd, title);
system(cmd);
}
int main() {
setTitle("Hello Stackoverflow! I hope you can help me! feelssadman:(");
return 0;
}