Is this valid and recommended way of reusing const char * in C?
Context: I am writing test case which requires calling the same function twice but using a different C style char string, where string serves as the ID to the begin and end function of the testing API.
const char *str = "String1";'
CTX *c = new_context();
BeginCase(c, "%s", str);
if (!SUCCESS(c, func1(...)))
goto out;
if (!SUCCESS(c, func2(...)))
goto out;
EndCase(c, "%s", str);
str = "String2";
BeginCase(c, "%s", str);
if (!SUCCESS(c, func1(...)))
goto out;
if (!SUCCESS(c, func2(...)))
goto out;
out:
EndCase(c, "%s", str);
end_ctx(c);