How to pass char array[] to function accepting const char* arg
type and what is the most proper way of doing that?
Please ignore the fact that I'm using static 100 buffer in this example:
char buff[100];
sprintf_s(buff, sizeof(buff), "%s", unrelated);
Then I need to pass the buff
to the function accepting const char*
MyFunction(const char* path);
I tried passing it directly: MyFunction(buff)
and it works, but could someone exaplain why? and if there is better way to achieve the same result?