I know this is wrong:

char* getSomething() {
    char szLocal[5];
    /* Put something in the char array somehow */
    return szLocal;
}

...because szLocal can be destroyed sometime after the function returns.

But is this ok?

char* getSomethingElse() {
    return "something else";
}
c
Edit
Report