in C:
void _cdecl FUNCTION(char* target, IN CHAR **a, IN CHAR **b,IN CHAR**c)
then in R:
target = as.character(Please_set_a_fix_length)
.C(_your_srcs...)[[1]]
But it is **unsafe** if the length (size) of target is not fix (hence you can't free the malloc/alloc and it is actually a wild index).
I am sure you could be able to use R.h and Rinternal.h (use PROTECT ) to handle this but you really can't (as far as I know) compile such thing using Visual Studio.
Rcpp might (I am not sure) be useful to link external dll. But Rcpp requires POSIX or gcc/llvm alike. According to other developers, VS C++ and GNU-R won't work well. But you could try and show us the result.
Thanks!