I don't know why I can't get this function to work, but I've spent all day and all night searching and have found nothing but problems. gets_s(buffer, size) is supposed to be a more direct, more secure replacement for gets(). So, why is it that on VC++ compiler, I still get buffer overflows even though I specify the sizeof(buffer) as the second argument? And on OS X (Darwin), it won't even compile, I get this error:
Undefined symbols:
"_gets_s", referenced from:
_main in ccHlsIH2.o
ld: symbol(s) not found
collect2: ld returned 1 exit status