I've hit this in my "trying to learn C++ adventure". The *_s functions are Microsoft only. For sprintf_s you might try the POSIX snprintf:
Code:
int snprintf(char *str, size_t size, const char *format, ...);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
snprintf(), vsnprintf(): _BSD_SOURCE || _XOPEN_SOURCE >= 500 ||
_ISOC99_SOURCE; or cc -std=c99
The functions snprintf() and vsnprintf() write at most size bytes
(including the trailing null byte ('\0')) to str.
This is from the man pages with glibc version 2.2