strcat is extremely unsafe strcpy is also extremely unsafe. sprintf is the almost unsafe.
Don't have sprintf_s, strcpy_s or any _s functions available to me.
Please tell something from all the basic available libraries like stdio.h, stdlib.h, string.h. Or create any custom function to do it. I don't need something "safer" I need the "safest" possible one. Other posts mentioned only _s functions and strncat being "safer" which doesn't answer my question.
Concatenation string types: const char*, and function must return answer in const char* format.
Tried all strcpy, strcat, sprintf functions in every possible way but didn't get any result.
please tell answer in this format:
const char* func(const char* s1,const char* s2){
//process concated_const_str=s1+s2
return concated_const_str;
}
Objective creitaria of measuring the safety of the function: any possible memory leaks must be handled carefully.